Upgrade to Pro — share decks privately, control downloads, hide ads and more …

NPM - tools you should know about

Karol Danko
February 27, 2017

NPM - tools you should know about

Talk about few good-to-know tools and services to make your life easier.

Presented at PragueJS meetup.

Karol Danko

February 27, 2017
Tweet

Other Decks in Technology

Transcript

  1. 7 $ npm install react NPM - základy node_modules $

    npm init package.json $ npm install react -S node_modules Update package.json
  2. Semver 8 2 . 4 . 1 MAJOR MINOR PATCH

    API change New feature Fix
  3. NPM outdated $ npm outdated Package Current Wanted Latest Location

    glob 5.0.15 5.0.15 6.0.1 test-outdated-output nothingness 0.0.3 git git test-outdated-output npm 3.5.1 3.5.2 3.5.1 test-outdated-output local-dev 0.0.3 linked linked test-outdated-output once 1.3.2 1.3.3 1.3.3 test-outdated-output 13
  4. npm shrinkwrap 15 "console.table": "^0.x" "console.table": { "version": "0.7.0", "from":

    "console.table@>=0.7.0", "Resolved": "https://registry.npmjs.org/console.table/ -/console.table-0.7.0.tgz" } package.json npm-shrinkwrap.json $ npm shrinkwrap
  5. Npm install & git 16 $ npm install react $

    npm install git://github.com/visionmedia/express.git
  6. depcheck $ npm install --global depcheck $ depcheck Unused dependencies

    * mongoose * nodemon Unused devDependencies * coffee-script * phantomjs-prebuilt Missing dependencies * qs 18
  7. 22

  8. Security tools • Vulnerability database > package.json analysis • Github

    integration (checks & fixes) • CLI tools • New vulnerabilities warnings (email, slack, …) 23
  9. Snyk.io 25 $ npm install snyk --global ... $ snyk

    test ✓ Tested 225 dependencies for known vulnerabilities, no vulnerable paths found.
  10. 28 Is it stable? Are the devs active ? When

    was the last update ? Will it last more than a year ? Will it fuck up my project ? How to check the quality ??? 400’000 modules ?!
  11. Npms.io 30 • Evaluates packages based on ◦ Quality ◦

    Popularity ◦ Maintenance ◦ Score
  12. 31

  13. npmcompare.com 32 • Direct package comparison ◦ Nr. of downloads

    ◦ Nr. of pull requestov ◦ Issues ◦ … ◦ Overall points
  14. Quality assurance tools 34 • Not easy to automate •

    Good module will save you time in the long run
  15. Yarn • “New kid on the block” - published on

    11.10.2016 • By Facebook • Very active development 36 $ npm install yarn --global $ yarm
  16. Yarn...like NPM, but... • Lock file is default • Offline

    cache is default • Parallel download / install • Nicer outputs 37