Run a check on your npm modules before serving Broccoli

To check your node modules when you start Broccoli you can use the npm module npm-check. You get a test everytime you start Broccoli. Very useful if you work together with multiple developers.

To install npm-check you type npm install npm-check.

Create a folder scripts in your root folder of your project. Navigate into it and create a start.sh with this contents:

#!/usr/bin/env bash

# Run a check on installed npm modules
./node_modules/npm-check/bin/cli.js -s && echo "" # Add a newline

# Last but not least run the favorite vegetable
./node_modules/broccoli-cli/bin/broccoli serve

Add the start script in your package.json.

{
  ...
  "scripts": {
    "start": "./scripts/start.sh",
    ...
  },
  ...
}

Now you can run npm run start or if you don’t like typing use this shortcut npm start.

Happy coding! – Found a mistake or a typo? Please submit a PR to my GitHub-repo.

Get my next post right in your inbox via Blogsend
(I don't get your email address so I can't spam you)

Like this post? Follow @adriaanvrossum on Twitter