Git Product home page Git Product logo

npm-scripts-info's People

Contributors

erikkemperman avatar srph avatar zkochan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

npm-scripts-info's Issues

Adding scripts descriptions to the scripts property

IMHO, the descriptions in a different section are a little bit hard to read/edit.

I think it would be nice to add the possibility to write the descriptions in the scripts property by prefixing the script name with a ?

For example, instead of this

{
  "name": "my-project",
  "scripts": {
    "info": "npm-scripts-info"
  },
  "scripts-info": {
    "info": "Displays information about the scripts.",
    "watch:build": "Compiles the scripts and watches for changes.",
    "start": "Kickstarts the application."
  }
}

This can be written

{
  "name": "my-project",
  "scripts": {
    "info": "npm-scripts-info",
    "?info": "Displays information about the scripts.",
    "?watch:build": "Compiles the scripts and watches for changes.",
    "?start": "Kickstarts the application."
  }
}

Furthermore, if the description will start with echo, it'll be possible to view it through npm run. Thus having this package.json

{
  "name": "my-project",
  "scripts": {
    "info": "npm-scripts-info",
    "?info": "echo Displays information about the scripts.",
    "?watch:build": "echo Compiles the scripts and watches for changes.",
    "?start": "echo Kickstarts the application."
  }
}

npm run ?start will output the description of the start script to the console. npm-scripts-info can use the same description and just remove the echo part.

I can implement this new feature if you like it.

Allow the JavaScript API to accept a package.json obect

Currently npm-scripts-info automatically loads the package json from the current working directory. This makes the module not reusable.

This change will allow to write a mos plugin for generating scripts documentation sections

I can make a pull request today with this update

Security Advisory 1753 - Regular Expression Denial of Service

This advisory has appeared when running npm audit on a project with version 0.3.7 of npm-scripts-info:

URL: https://npmjs.com/advisories/1753

┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ trim-newlines                                                │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=3.0.1 <4.0.0 || >=4.0.1                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ npm-scripts-info [dev]                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ npm-scripts-info > meow > trim-newlines                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/1753                            │
└───────────────┴──────────────────────────────────────────────────────────────┘

$npm_package_config_ variables aren't interpolated in output

First, thank you for making this awesome package! 🙇‍♂️

Given this package.json

{
  "config": {
    "reactStorybookPort": "9001"
  },
  "scripts": {
    "info": "npm-scripts-info",
    "?storybook": "Runs react-storybook on port $npm_package_config_reactStorybookPort",
    "storybook": "start-storybook -p $npm_package_config_reactStorybookPort -c .storybook"
  }
}

Running yarn run storybook interpolates to start-storybook -p 9001 -c .storybook, while running yarn run info displays

storybook:
  Runs react-storybook on port $npm_package_config_reactStorybookPort

Do you think we should enable config interpolation in descriptions? Would you like me to look into implementing such a PR?

env: node\r: No such file or directory

Hi 👋

I was using the typescript starter project and was getting the error env: node\r: No such file or directory when I tried to run npm-scripts-info.

You can read that thread for the details so I won't duplicate them here.
I was just wondering if you had seen this error before as it seems to be isolated to npm-scripts-info.

If you haven't seen this before, feel free to close as I realize this isn't the most helpful bug report 😞.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.