Skip to content

ga-wdi-boston/node-template

Repository files navigation

General Assembly Logo

node-template

Updating Dependencies

At the beginning of each cohort update package.json:

  • replace all dependent package versions with a glob (*).
  • rm -r node_modules.
  • npm update --save.
  • npm update --save-dev.
  • npm install
  • grunt test

Fix errors and conflicts as necessary.

Structure

Dependencies are stored in package.json.

Do not configure grunt packages directly in the Gruntfile.js. Instead, store configurations in the grunt directory. You won't need a top-level key, since that's generated by the Gruntfile.js based on the filename of the configuration object stored in the grunt directory.

Developers should store JavaScript files in lib. If an entry point is needed, it can go in the root of the project; index.js is the node default; app.js, main.js, or server.js might be appropriate depending on the task.

grunt server will start nodemon on bin/index.js.

Code blocks

With this in the markdown:

<!-- start code block file="lib/example.js" -->

This gets replaced with the contents of lib/example.js

<!-- end code block -->

running:

cp README.md README.bak
bin/add-code-block.js README.bak >README.md

produces:

'use strict'

module.exports = {
  sync: (value) => value,
  async: (value, cb) => setTimeout(() => cb(null, value), 0),
  promise: (value) => Promise.resolve(value)
}

Check the markdown source to see what happens.

Tasks

Developers should run these often!

  • grunt nag: runs code quality analysis tools on your code and complains.
  • grunt test: runs any automated tests; may depend on grunt build.
  • grunt: runs both nag and then test
  • grunt make-standard: reformats all your code in the standard style.
  1. All content is licensed under a CC­BY­NC­SA 4.0 license.
  2. All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact legal@ga.co.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published