UNPKG
@micro-cli/shared-utils
Version:
latest (1.0.8)
1.0.8
1.0.7
1.0.5
1.0.4
1.0.3
1.0.1
1.0.0
shared utils for micro-cli
github.com/zl-mdc/Micro-cli.git
zl-mdc/Micro-cli
@micro-cli/shared-utils
/
lib
/
pkg.ts
11 lines
(9 loc)
•
266 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
import
fs
from
'node:fs'
;
import
path
from
'node:path'
;
import
{ readPackage }
from
'read-pkg'
;
export
default
(
context
:
string
) => {
if
(fs.
existsSync
(path.
join
(context,
'package.json'
))) {
return
readPackage
({
cwd
: context }); }
return
{}; };