Skip to content

nullice/exec-x

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🦀 exec-x

dynamically execute commands in npm script with variables .

Features:

  • Use dynamic data form package.json (name, verison, project path) for npm scripts.
  • change npm script current working directory.

package.json:

    "execPath": "./../../",
    "scripts": {
        "dev": "exec-x \"cross-env Cells_EE_DIR={{project}} npm run dev  \"",
        "build": "exec-x \"cross-env Cells_EE_DIR={{project}} npm run build\"",
        "rebuild:native": "exec-x \" npm run rebuild -f -w sharp sqlite3 -m {{project}}/native {{name}}-v{{version}} \""
    },

Install

npm i -D exec-c

Usege

use package.json data in npm scripts.

"exec-x \"cross-env XXX={{project}} npm run dev  \""
  • {{project}}:project path (current modules path)
  • {{name}}:modules path
  • {{version}}:modules version
  • {{workPath}}:current working directory (Will be affected by execPath)

change npm script current working directory

  1. add execPath into package.json
  2. use exec-x in npm script

package.json:

    "name": "YOU-MODULES"
+   "execPath": "./../../",
    "scripts": {
        "dev": "exec-x \"cross-env Cells_EE_DIR={{project}} npm run dev  \"",
    },

About

🦀 dynamically execute commands in npm script with variables .

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published