@xornot/run-script

Used in package.json "scripts" to invoke other scripts using either npm or yarn, whichever was used to initially invoke the script.

Usage no npm install needed!

<script type="module">
  import xornotRunScript from 'https://cdn.skypack.dev/@xornot/run-script';
</script>

README

@xornot/run-script

Used in package.json "scripts" to invoke other scripts using either npm or yarn, whichever was used to initially invoke the script.

Getting Started

Install it as a dev dependency of your project.

npm i -D @xornot/run-script
yarn install --dev @xornot/run-script

Use it in the "scripts" section of your package.json file.

{
  "scripts": {
    "foo": "run-script bar",
    "bar": "echo 'Hello, world!'"
  }
}

Now, if you run npm run foo, then the foo script will be npm run bar. If you run yarn run foo, then the foo script will be yarn run bar.