Giter Site home page Giter Site logo

rousan / sl Goto Github PK

View Code? Open in Web Editor NEW
24.0 4.0 0.0 792 KB

:beers: An utility tool to list npm scripts from package.json file

Home Page: https://rousan.io/sl/

License: MIT License

JavaScript 100.00%
sl npm-script-list script script-list npm-ls list cli nom-ls-scripts ls

sl's Introduction

NPM Script listing Demo

Build Status NPM version Required Node version NPM total downloads Contributors License

sl

A tiny and useful tool to list all npm scripts from package.json file.

sl = script list

Requirements

node >= v4.0.0

Note: If node and npm are not installed, Install them from here.

Installation

Install it from npm:

$ npm install -g script-list

Usage

Access it from terminal or command prompt by sl command.

$ sl

   MyAwesomeProject
    - build           : babel src -d lib
    - start           : node node_modules/react-native/local-cli/cli.js start
    - test            : jest --coverage --verbose

Script List for Multiple Projects

$ sl MyAwesomeProject MyAwesomeProject2

   MyAwesomeProject
    - build           : babel src -d lib
    - start           : node node_modules/react-native/local-cli/cli.js start
    - test            : jest --coverage --verbose


   MyAwesomeProject2
    - ng        : ng
    - test:e2e  : ng e2e
    - test:unit : ng test
    - test      : ng e2e && ng test

Use Globbing

$ sl **/*

   MyProject1
    - build           : babel src -d lib
    - start           : node node_modules/react-native/local-cli/cli.js start
    - test            : jest --coverage --verbose


   MyProject2
    - ng        : ng
    - test:e2e  : ng e2e
    - test:unit : ng test
    - test      : ng e2e && ng test


   MyProject3
    - build : babel src -d lib
    - start : node src/cli.js
    - test  : mocha test

Note: It has built-in support for path globbing on windows.

Contributing

Your PRs and stars are always welcome.

Checkout the CONTRIBUTING guides.

sl's People

Contributors

rousan 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

Watchers

 avatar  avatar  avatar  avatar

sl's Issues

Question

What is the difference with the command npm ls and npm ls --depth=0

[Feature Request] Group all not found errors while globbing

What happens now :

Running this command using sl * on a directory which contains multiple project directories (some of which are not node projects) shows console output like this:

   asp-project-1
   No package.json file found: C:\Projects\asp-project-1


   python-project-2
   No package.json file found: C:\Projects\python-project-2


   somefile.zip
   Path needs to be a directory: C:\Projects\somefile.zip


   node-project-1
    - test : echo "Error: no test specified" && exit 1

Expectation:

Instead of mixing (in terms of line-wise console output) the node project folders with other files and folders, group the not found files and non-node project folders and show them in the end.

Something like this:

   node-project-1
    - test : echo "Error: no test specified" && exit 1

   Ignored files and folder
   ------------------------
   asp-project-1
   No package.json file found: C:\Projects\asp-project-1


   python-project-2
   No package.json file found: C:\Projects\python-project-2


   somefile.zip
   Path needs to be a directory: C:\Projects\somefile.zip

You might also show the ignored section in some other way, like just printing out the files/folders name without detailed error reason for each of them.

Also, you might introduce a new flag to show the output in this way (like sl * --ignore), keeping the default output as it is. But atleast someway to have this kind of output will be nice.

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.