Execute npm script using javascript

Andon Mitev

I'm trying to execute npm script using js

Have following in package.json

"script": {
   "commit": "git commit -m {dynamic message}"
}

And in the JS i want to reach to this script, execute it and send dynamic message to it

Jack

This will run commands it could be any command

const { execSync } = require('child_process')
execSync("some-command")

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to execute npm script using grunt-run?

Execute script after specific delay using JavaScript

Using AJAX to execute a PHP script through a JavaScript function

execute script on GCP Instance using Google Javascript API

Phoenix framework - execute NPM script in subdirectory

Execute ssh shell script from npm command

Pass arguments to npm script in order to execute

Execute npm Script in a different Folder with python

Execute multiple JS file on NPM script NodeJS

Execute PHP script inside JavaScript

Execute Shell Script in JavaScript IF Clause

execute script on remote using curl

How to execute a script using crontab

Execute php script inside a javascript script

How to scroll a webpage using selenium webdriver in Python without using javascript method execute_script()

NPM conditional script (Windows / Mac) shall execute different commands)

Execute npm command in child directory from netcore deployment script

Execute a PHP function from within a Javascript script

javascript: insert script tag inside div and execute it

Javascript : execute a script after location.href

Javascript script for form submit doesn't execute

Execute bash script with params from Javascript

JavaScript code does not execute in a window opened by a script

is it possible to run npm script from Javascript

Javascript function will not execute using Cookies

Execute Javascript using Node in terminal

Execute Javascript using Selenium in Python

Using JavaScript NPM package with import

Python selenium how to execute execute_script on a JavaScript element with arguments