question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make it easier to use inside npm script

See original GitHub issue

Right now I need to do this:

  "scripts": {
        "ls": "node -e \"console.log(require('cash')('ls -l')); process.exit();\""
  }

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
nfischercommented, Mar 11, 2016

Perhaps we could implement the -c option. From Bash’s man page:

       -c        If the -c option is present, then commands are read from the first non-option argument command_string.  If  there  are
                 arguments after the command_string, they are assigned to the positional parameters, starting with $0.
1reaction
danielbayleycommented, Jul 16, 2017

@rofrol Once cash can accept -c 'input' (#75), then you can simply put script-shell = cash inside .npmrc and it should just work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mastering NPM Scripts
NPM Scripts are a set of built-in and custom scripts defined in the package.json file. Their goal is to provide a simple way...
Read more >
How to have better NPM Scripts - Raul Melo
How to use the package scripty to help you have more maintainable and more powerful npm scripts.
Read more >
Using Npm Scripts as a Build Tool in 2022
In this article, we'll look at how to use project specific npm build scripts as a build tool and task runner, instead of...
Read more >
Helpers and tips for npm run scripts - Michael Kühnel
You can easily run scripts using npm by adding them to the "scripts" field in package.json and run them with npm run <script-name>...
Read more >
Creating an Npm-Only Build Step for JavaScript
Npm scripts are not quite as plug-and-play as Gulp or Grunt. Tutorials for the typical use cases make the entrance into a build...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found