import { SpawnSyncOptionsWithStringEncoding } from 'child_process' ; import spawn from './spawn' ; param { string [ ] } args param { SpawnSyncOptionsWithStringEncoding } options export default function runPackageScript ( args , options ? ) { const npmArgs = [ 'run' , ... args . slice ( 0 , 1 ) , '--' , ... args . slice ( 1 ) ] ; runPackageManagerCommand ( npmArgs , options ) ; } param { string [ ] } npmArgs param { SpawnSyncOptionsWithStringEncoding } options export function runPackageManagerCommand ( npmArgs , options ? ) { console . log ( `> npm ${ npmArgs . join ( ' ' ) }` ) ; spawn ( 'npm' , npmArgs , options ) ; }