UNPKG
@naandalist/patch-package
Version:
latest (8.1.6)
8.1.6
8.1.5
8.1.3
8.1.2
8.1.1
Fix broken node modules with no fuss
github.com/naandalist/patch-package
naandalist/patch-package
@naandalist/patch-package
/
src
/
getPackageVersion.ts
5 lines
(4 loc)
•
161 B
text/typescript
View Raw
1
2
3
4
5
export
function
getPackageVersion
(
packageJsonPath
:
string
):
string
{
// remove build metadata
return
require
(packageJsonPath).
version
.
replace
(
/\+.*$/
,
""
) }