The Nodeshift team recently improved the consistency of the projects we use to maintain our Node.js modules. We made sure that the same linter and tests—ESLint and Tape, for those interested—were used on all projects. We also added support information for the modules we publish to the npm registry. We looked to the Node.js Package Maintenance Working Group for the standardized support information to add.
Continue reading Add standardized support information to your Node.js modules
NPM 4 was released recently, about 2 weeks ago, and with it came some major changes. Some breaking, some not, but there is an interesting deprecation that happened with regards to the
Currently, if you had a prepublish entry in your package.json:
prepublish: "nsp check"
This would be run whenever you performed a
npm publish. Which is probably what you would expect with a name like prepublish.
Another thing was also happening though. When you ran
npm install with no arguments, the prepublish step would still be run — this is not what you would expect.
Continue reading “Node Package Manager 4 — Changes to Prepublish (NPM)”
Test-Driven-Development (TDD) is an increasingly popular, and practical, development methodology in today’s software industry, and it is easy to apply in Node.js – as we’ll see in this article. TDD forces much greater code test coverage, and if you aren’t already using it, I’d strongly encourage trying.
The process is: define a test that expects the output we want from our library, API, or whatever it is we’re testing to produce; ensure that the test fails – because we have not yet implemented any functionality; then write the implementation code required to make that test pass.
Continue reading “Test-Driven-Development for building APIs in Node.js and Express”