File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
- const rpj = require ( 'read- package-json-fast ' )
1
+ const PackageJson = require ( '@npmcli/ package-json' )
2
2
const runScriptPkg = require ( './run-script-pkg.js' )
3
3
const validateOptions = require ( './validate-options.js' )
4
4
const isServerPackage = require ( './is-server-package.js' )
5
5
6
- const runScript = options => {
6
+ const runScript = async options => {
7
7
validateOptions ( options )
8
- const { pkg, path } = options
9
- return pkg ? runScriptPkg ( options )
10
- : rpj ( path + '/package.json' )
11
- . then ( readPackage => runScriptPkg ( { ...options , pkg : readPackage } ) )
8
+ if ( options . pkg ) {
9
+ return runScriptPkg ( options )
10
+ }
11
+ const { content : pkg } = await PackageJson . normalize ( options . path )
12
+ return runScriptPkg ( { ...options , pkg } )
12
13
}
13
14
14
15
module . exports = Object . assign ( runScript , { isServerPackage } )
You can’t perform that action at this time.
0 commit comments