Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass arguments to npm script? #37

Open
stevenvachon opened this issue Apr 5, 2017 · 6 comments
Open

Pass arguments to npm script? #37

stevenvachon opened this issue Apr 5, 2017 · 6 comments

Comments

@stevenvachon
Copy link

stevenvachon commented Apr 5, 2017

"scripts": {
  "build": "node build.js",
  "watch": "npm-watch build"
},
"watch": {
  "build": "*.js"
}
npm run watch -- --param=value

should effectively do:

npm run build --param=value
@stevenvachon
Copy link
Author

@M-Zuber hello?

@M-Zuber
Copy link
Owner

M-Zuber commented Jun 16, 2017

Sorry been a bit behind in getting to issues here...
😢
Is this a feature request, or something you expected to work but doesn't?

@stevenvachon
Copy link
Author

Feature request.

@stevenvachon
Copy link
Author

We can use npx instead of npm run, which will be implemented into a future version of npm as npm exec.

stevenvachon added a commit to stevenvachon/npm-watch that referenced this issue Jun 23, 2017
stevenvachon added a commit to stevenvachon/npm-watch that referenced this issue Jun 23, 2017
…when task name is specified. It is not currently possible to support arguments without a task because argv[2] was hard-coded to be the task name. If it were defined as “--arg”, it would treat that as the task name.

fixes M-Zuber#37
stevenvachon added a commit to stevenvachon/npm-watch that referenced this issue Jun 23, 2017
…when task name is specified. It is not currently possible to support arguments without a task because argv[2] was hard-coded to be the task name. If it were defined as “--arg”, it would treat that as the task name.

fixes M-Zuber#37
@M-Zuber
Copy link
Owner

M-Zuber commented Jun 25, 2017

We can use npx instead of npm run, which will be implemented into a future version of npm as npm exec.

Sounds interesting, would have to read up more on it

@M-Zuber M-Zuber assigned M-Zuber and unassigned M-Zuber Jun 26, 2017
stevenvachon added a commit to stevenvachon/npm-watch that referenced this issue Jun 27, 2017
…when task name is specified. It is not currently possible to support arguments without a task because argv[2] was hard-coded to be the task name. If it were defined as “--arg”, it would treat that as the task name.

fixes M-Zuber#37
stevenvachon added a commit to stevenvachon/npm-watch that referenced this issue Jun 28, 2017
…when task name is specified. It is not currently possible to support arguments without a task because argv[2] was hard-coded to be the task name. If it were defined as “--arg”, it would treat that as the task name.

fixes M-Zuber#37
stevenvachon added a commit to stevenvachon/npm-watch that referenced this issue Jun 28, 2017
…when task name is specified. It is not currently possible to support arguments without a task because argv[2] was hard-coded to be the task name. If it were defined as “--arg”, it would treat that as the task name.

fixes M-Zuber#37
@M-Zuber
Copy link
Owner

M-Zuber commented Feb 7, 2019

So I looked into this some, and the current set up will not allow for this without some uncomfortable twisting.
Leaving this open, but it is further down on the roadmap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants