NPM script naming convention

I have a script in mine package.jsonthat looks something like this:

{
    ...
    scripts: {
        ...
        "testdb:e2e": "TESTDB_ENV='...' gulp mocha:e2e:backend && gulp mocha:e2e:frontend"
   }
    ...
}

And I want to add a script to specifically call the backend or interface with my test environment. But I wanted to know what the NPM script naming convention is, but I can't find the documentation on it. I think of colon names like gulp, something like this:

"testdb:e2e": "TESTDB_ENV='...' gulp mocha:e2e:backend && gulp mocha:e2e:frontend",
"testdb:e2e:backend": "TESTDB_ENV='...' gulp mocha:e2e:backend",
"testdb:e2e:frontend": "TESTDB_ENV='...' gulp mocha:e2e:frontend"

Is there any specific naming convention for names in npm scripts?

+4
source share
1 answer

No.

Inside, however, npm uses things like pretestand posttest.

This is not the best thing, so you may prefer to use your own.

+2
source

Source: https://habr.com/ru/post/1622544/


All Articles