How can scripts communicate with one another through passing arguments?

"scripts": {
    "dev": "npm run development",
    "development": "run-something",
    ....

When invoking my script, I use the following command:

npm run dev

This is a convenient shortcut that executes the standard command npm-run-development.

Is there a way to pass arguments from the shortcut command to the standard command? For instance, how can the test argument be transmitted from npm run dev to npm run development?

npm run dev -- --test=abc

Answer №1

To make your shorthand commands work, simply include -- at the end:

"scripts": {
   "dev": "npm run development --",
   "development": "do-something",

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Having difficulties accessing the properties of a dynamically created JSON object with ng-repeat functionality

Within an ng-repeat loop, I have implemented a radio button that assigns the entire person object to a scope variable as shown below: <li ng-repeat="person in people"> <label>{{person.name}} <input type="radio" ng-model="$parent.s ...

Issues with Ajax arise once URL re-routing is activated

When loading content using AJAX and ASP.NET web-methods, the following code is used to trigger the Ajax request: var pageIndex = 1; var pageCount; $(window).scroll(function () { if ($(window).scrollTop() == $(document).height() - $(window).height()) ...

Using v-model with an input file is not supported

Is there a solution for not being able to use v-model in an input tag with type="file"? Here is an example of the HTML code causing this issue: <input v-model="imageReference" type="file" name="file"/> ...

Oops! The Route.post() function is looking for a callback function, but instead, it received an [object Object

Looking to integrate a password reset feature in my web app, but encountering the error mentioned in the title. Here's a snippet of my code: main.js: const router = express.Router(); const AsyncNewPassword = require('./controller/asyncnewpasswor ...

How to switch between classes for elements and return to the original one when none of the elements is chosen

Hello there, I need some assistance. Here's the scenario: I am working with a grid of six items. My goal is to have the first item in the grid become active by default. When the user hovers over any of the remaining five items, I want the active clas ...

The step-by-step guide on implementing secure authentication using cookies in Next.js

I am encountering a minor issue. I am still very new to Nextjs and I am attempting to learn by creating an app. I have successfully implemented a Login system using Next, but I am facing some challenges in securing routes. After a successful login, I have ...

Facing a EACCES symlink error while trying to setup expo-cli

I am encountering some difficulties while attempting to install expo-cli using the command npm install -g expo-cli. Despite looking through other similar posts, none of the recommended solutions seem to work for me. I suspect that the issue lies in the way ...

The link in the drop down select is not functioning in IE8/9. When trying to open the drop down select link, an

Could use some help with IE8 and 9 compatibility, can't seem to find a solution. This code works smoothly on Chrome, FF, and Safari. There are two dropdown menus, each with two links. Every dropdown menu has its own "Buy Now" button. Upon selecting ...

Enhance Your Search Functionality with an Angular Pipe

I created a custom pipe that filters the search field and displays a list of items based on the search text. Currently, it only filters by companyDisplay, but I want to also filter by companyCode and companyName. JSON [{ companyDisplay: "ABC", co ...

Executing filepicker.io Javascript API calls may lead to unsafe errors in Javascript

I am currently using AngularJS and encountering an issue when trying to call filePicker.pickAndStore from my Upload controller. Every attempt to use a filepicker.io API function triggers an "Unsafe Javascript attempt" error: The frame requesting access ...

Retrieve the information transmitted to an EJS file within a separately included JavaScript file

I'm currently utilizing express js to render a file by using: res.render('plain',{state:'admin'}) The file plain.ejs includes main.js: <script src ="/main.js"></script> I need assistance on how to access the state v ...

Generate a text string by choosing options from a form

Greetings! I have a form for creating a file, where the file name is determined by user selections. It's similar to "display text as you type" mentioned here, but my form includes radio buttons in addition to a textbox. For example: Textbox: "Name gi ...

Why is React's nested routing failing to render properly?

click here for image portrayal I am currently attempting to integrate react router, specifically a nested router. However, when I click the links on the contact page, no results are being displayed. Any assistance would be greatly appreciated. For more in ...

How can a form be submitted in Extjs without using ajax?

Hello there! I'm attempting to submit an extjs form without using ajax and display the result on the next page. Below is my code: Ext.define('test.from', { extend: 'Ext.form.Panel', alias: 'widget.test.form', ...

fetch the image data from the clipboard

Hey there! Is it possible to use JavaScript to retrieve an image from the system clipboard (Windows/Mac) and paste it into a website? ...

What is the method for retrieving all elements, regardless of duplicative data?

I need assistance with a project in which I am attempting to extract brand names and prices from a website. Below is the code I am currently using: List<WebElement> list_of_products = driver.findElements(By.xpath(loc.getProperty("brandName" ...

Exploring JSON data through key-value pairs

When faced with a de-serialized JSON object that has an arbitrary structure and mixed value types... var data = { 'a':'A1', 'b':'B1', 'c': [ {'a':'A2', 'b':true}, ...

Transfer sound data blob to server and store it as a file

Currently, I have 3 buttons on my webpage - one to start recording audio, one to stop the recording, and one to play the recorded audio. Using MediaRecorder makes it easy to capture audio as a blob data. However, I am facing issues when trying to upload th ...

Shift attention away from AG-Grid

AG Grid is being used on a website and when a user clicks a cell, it becomes focused with a blue outline. I am looking to remove this focus when the user clicks on specific elements on the site, but I am unsure of how to achieve this. Is there a method or ...

The callback function in a Node.js loop can be executed in parallel

Exploring the behavior of callbacks invoked by async.parallel functions has led to an interesting observation: the execution flow appears to differ depending on whether the callback utilizes a parameter or not. var async = require("async"); function cr ...