SlideShare a Scribd company logo
Modules and Artifacts
in NPM
ANTON
CHEREDNIKOV
Summer. Sea. JavaScript.
Agenda
● Artifacts and Modules
● why?
● decomposition
● examples
● “best practices”
● publish
● Maintain modules without pain
● audit, versioning, dependencies,
expectations...
● Registry
● issues, public/private registry,
alternatives...
● CI / CD
Why?
● Isolating components that are duplicated:
○ service core library
○ logs
○ utils
○ db models
● Own corporate / project standards
● Flexibility in development
● Using the advantages of versioning convenience
Decomposition
● Libraries provide a way to share functionality with
different teams and services.
● (!) Shared code can be a point, which will create an
dependencies between services (ex .: ORM DB models)
● Service-core library: an approach that allows you to
create some kind of standards for your micro-services
Modules and artifacts in NPM by Anton Cherednikov
“best” practices
“best” practices
Publish
● configure package.json
● describe README.MD
● set default credentials: $ npm adduser / npm login
● tap $ npm publish
● enjoy: $ npm i %package_name%
Maintain modules without PAIN
Audit
● review your package: $ npm publish --dry-run
● or just use $ npm pack to see result
● describe the entries to be included when your package
is installed as a dependency, use files property
(package.json)
● take care of your dependencies: $npm audit/outdated
Semantic Versioning
● MAJOR version when you make incompatible API
changes
● MINOR version when you add functionality in a
backwards-compatible manner
● PATCH version when you make
backwards-compatible bug fixes.
Dependencies
● ^version “Compatible with version” (by default: $ npm i %package_name%)
● version Must match version exactly
● ~version - Approximately equivalent to version
● >version Must be greater than version
○ >=version
○ <version
○ <=version
● * Matches any version
Expectations
● Any project structure
● Description required (wiki, REAME.MD)
● Tests - is a must
○ coverage control
○ reports
○ automated
● Use the advantages of versioning
● All that can be automated - should be automated
Registry
Motivation to use private registry
Issues
● Public registry returns 404 for a package installed before
● https://status.npmjs.org/
● https://status.yarnpkg.com/
● Many packages suddenly disappeared (all dependencies of webpack-related modules):
● https://www.npmjs.com/package/infinity-agent
● https://www.npmjs.com/package/timed-out
● https://www.npmjs.com/package/pinkie-promise
● https://www.npmjs.com/package/require-from-string
● …
Issues
https://status.npmjs.org/incidents/41zfb8qpvrdj
23 March 2018
left-pad
Left-pad module - is an example of unexpected
behavior of public registry.
23 March 2018: React, Babel, and a bunch of other
popular NPM packages broke.
A simple NPM package called left-pad was installed
as a dependency in React, Babel, and other
packages.
The owner just remove it from npm. RIP.
Azer Koçulu - left-pad creator
left-pad: O(N^2)
Modules and artifacts in NPM by Anton Cherednikov
Public and private registry
● default: registry.npmjs.org
● public (may do anything with any dependencies)
● private:
○ MyGet (https://www.myget.org) —which costs
US$ 9/month for starter plan and you only
would have 2 contributors and 1GB storage
○ NPMJS.COM (https://www.npmjs.com) —
which costs US$ 7 per user per month.
(Organize packages and teams into
permissions groups)
○ * Custom solution
Alternative
● npm install --save username/repo#branch-name
● Static repository url
● Authentication required
● Private repository: IP whitelist config required
● We don’t use registry
● If you want to use all benefits of npm package system in your company without
sending all code to the public, and use your private packages just as easy as
public ones.
● Out of the box with its own database
● Caching the downloaded modules
● Mirroring (proxy) other registries
● Secure. Supported npm/yarn audit
● Supported Installing packages (npm install, npm upgrade) and publishing
packages (npm publish)
simple, zero-config-required local private npm registry
https://github.com/verdaccio/verdaccio
$ npm install --global verdaccio
$ npm set registry http://YOUR_DOMAIN.COM/
$ npm publish --registry http://YOUR_DOMAIN.COM/
● Full support for managing npm packages and ensures
optimal and reliable access to npmjs.org
● Mirroring (proxy)
● Aggregating: access to multiple npm registries from a single
URL. (overcomes the limitation of the npm client which can
only access a single registry at a time)
● Assign access privileges according to projects or
development teams.
Modules and artifacts in NPM by Anton Cherednikov
CI  CD
npm ci
● NPM 5.7.0 introduced the new npm ci command
● it’s faster — some report a 2–5x speed improvement of their CI
● it only considers package-lock.json (make sure the file is checked in)
● it never updates package.json or package-lock.json
● it throws away existing node_modules and starts with a clean slate
$ npm install
added 184 packages in 12.103s
$ npm ci
added 184 packages in 5.922s
* use it when you cook your container
npm ci benchmark
Basic CI/CD flow
● unit tests - run on each commit. Quality control.
● manual publish - publish npm module to artifactory. Manual action.
Appends a prefix to the artifact name
● manual unpublish - remove npm module from artifactory
● autopublish - triggered only when changes were merged in master. Publish
npm module to artifactory without any prefixes
Modules and artifacts in NPM by Anton Cherednikov
Summary
● Choose the right solution for each individual situation (git dependency,
public/private registry, registry provider...)
● Avoid public registry
● Audit your packages (versioning, dependencies, scheduled checks…)
● Collect old artifacts
● Build process of deployment your npm modules with a team (example:
prefix for development modules, publish/unpublish package terms)
● All that can be automated - should be automated: CI / CD
THANK YOU
Contacts
https://www.linkedin.com/in/anton-cherednikov/
https://www.facebook.com/profile.php?id=100009501190852
https://t.me/a_cherednikov

More Related Content

What's hot (20)

PDF
OSDC 2017 - Dr. Udo Seidel - VMwares (open source) Way of Container
NETWAYS
 
PDF
openSUSE Conference 2017 - YaST News
lslezak
 
ODP
Dockerfiles & Best Practices
Avash Mulmi
 
PDF
Vagrantfordevops
Deepanshu Gajbhiye
 
PDF
Bootify Yyour App from Zero to Hero
EPAM
 
PDF
Nuxeo World Session: Building Packages for the Nuxeo Marketplace
Nuxeo
 
PDF
Nuxeo and JavaScript
Nuxeo
 
PPTX
Testing Rest with Spring by Kostiantyn Baranov (Senior Software Engineer, Gl...
GlobalLogic Ukraine
 
KEY
Continuous Integration Step-by-step
Michelangelo van Dam
 
PDF
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
Igalia
 
PDF
Working with npm packages
Tomasz Bak
 
PDF
How Can OpenNebula Fit Your Needs: A European Project Feedback
NETWAYS
 
PDF
Using ssh as portal - The CMS CRAB over glideinWMS experience
Igor Sfiligoi
 
PDF
Daniel Sloof: Magento on HHVM
Meet Magento Poland
 
PDF
How can OpenNebula fit your needs - OpenNebulaConf 2013
Maxence Dunnewind
 
PPTX
Magento 2 Deploy Strategies
Rafael Corrêa Gomes
 
PDF
OpenCms Days 2015 How do you develop for OpenCms?
Alkacon Software GmbH & Co. KG
 
ODP
#1 Backend Meetup - Symfony 2 - wstęp
Maciej Grajcarek
 
PDF
Dev/Stage/Prod Parity with Vagrant
Mike Bybee
 
PPTX
Mono Repo
Zacky Pickholz
 
OSDC 2017 - Dr. Udo Seidel - VMwares (open source) Way of Container
NETWAYS
 
openSUSE Conference 2017 - YaST News
lslezak
 
Dockerfiles & Best Practices
Avash Mulmi
 
Vagrantfordevops
Deepanshu Gajbhiye
 
Bootify Yyour App from Zero to Hero
EPAM
 
Nuxeo World Session: Building Packages for the Nuxeo Marketplace
Nuxeo
 
Nuxeo and JavaScript
Nuxeo
 
Testing Rest with Spring by Kostiantyn Baranov (Senior Software Engineer, Gl...
GlobalLogic Ukraine
 
Continuous Integration Step-by-step
Michelangelo van Dam
 
An Overview of the Open Source Vulkan Driver for Raspberry Pi 4
Igalia
 
Working with npm packages
Tomasz Bak
 
How Can OpenNebula Fit Your Needs: A European Project Feedback
NETWAYS
 
Using ssh as portal - The CMS CRAB over glideinWMS experience
Igor Sfiligoi
 
Daniel Sloof: Magento on HHVM
Meet Magento Poland
 
How can OpenNebula fit your needs - OpenNebulaConf 2013
Maxence Dunnewind
 
Magento 2 Deploy Strategies
Rafael Corrêa Gomes
 
OpenCms Days 2015 How do you develop for OpenCms?
Alkacon Software GmbH & Co. KG
 
#1 Backend Meetup - Symfony 2 - wstęp
Maciej Grajcarek
 
Dev/Stage/Prod Parity with Vagrant
Mike Bybee
 
Mono Repo
Zacky Pickholz
 

Similar to Modules and artifacts in NPM by Anton Cherednikov (20)

KEY
Nodeconf npm 2011
Florent Jaby ヅ
 
PDF
Cover Your Apps While Still Using npm
Tierney Cyren
 
PPTX
Overview of Node JS
Jacob Nelson
 
PDF
open source product management (feat. npm)
Forrest Norvell
 
PDF
NPM THE GUIDE
Kameron Tanseli
 
PDF
NPM ecosystem threats
Giacomo De Liberali
 
PPTX
Node js packages [#howto with npm]
Andrii Lundiak
 
PDF
Introduction to NPM and building CLI Tools with Node.js
Suroor Wijdan
 
PPTX
GDG Morgantown, WV: Write code you can depend on!
Logan Spears
 
PPTX
Modular development in Node.js
Mehdi Valikhani
 
PDF
npm + browserify
maxgfeller
 
PPTX
NPM (Node Package Manager) A powerful package manager for JavaScript and Node.js
Amit Shinde
 
PPTX
Introduction to NodeJS JSX is an extended Javascript based language used by R...
JEEVANANTHAMG6
 
PDF
O365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
NCCOMMS
 
PDF
Distributing UI Libraries: in a post Web-Component world
Rachael L Moore
 
PDF
Introduccion Verdaccio ViennaJS
Juan Picado
 
PDF
An Introduction of Node Package Manager (NPM)
iFour Technolab Pvt. Ltd.
 
PPTX
Lecture 7-Working Nodejs Packagempresenration.pptx
GomathiUdai
 
Nodeconf npm 2011
Florent Jaby ヅ
 
Cover Your Apps While Still Using npm
Tierney Cyren
 
Overview of Node JS
Jacob Nelson
 
open source product management (feat. npm)
Forrest Norvell
 
NPM THE GUIDE
Kameron Tanseli
 
NPM ecosystem threats
Giacomo De Liberali
 
Node js packages [#howto with npm]
Andrii Lundiak
 
Introduction to NPM and building CLI Tools with Node.js
Suroor Wijdan
 
GDG Morgantown, WV: Write code you can depend on!
Logan Spears
 
Modular development in Node.js
Mehdi Valikhani
 
npm + browserify
maxgfeller
 
NPM (Node Package Manager) A powerful package manager for JavaScript and Node.js
Amit Shinde
 
Introduction to NodeJS JSX is an extended Javascript based language used by R...
JEEVANANTHAMG6
 
O365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
NCCOMMS
 
Distributing UI Libraries: in a post Web-Component world
Rachael L Moore
 
Introduccion Verdaccio ViennaJS
Juan Picado
 
An Introduction of Node Package Manager (NPM)
iFour Technolab Pvt. Ltd.
 
Lecture 7-Working Nodejs Packagempresenration.pptx
GomathiUdai
 
Ad

More from OdessaJS Conf (20)

PPTX
'GraphQL Schema Design' by Borys Mohyla. OdessaJS'2021
OdessaJS Conf
 
PDF
'How i came up with my talk' by Yurii Artiukh. OdessaJS'2021
OdessaJS Conf
 
PDF
"Is there life in react without redux" by Babich Sergiy. OdessaJS'2021
OdessaJS Conf
 
PPTX
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
OdessaJS Conf
 
PPTX
Андрій Троян. Розробка мікросервісів з NestJS. OdessaJS'2021
OdessaJS Conf
 
PPTX
Олексій Гончар "Використання Electron в розробці корпоративної відео-мессeндж...
OdessaJS Conf
 
PDF
Максим Климишин "Що такого особливого у пропозиції вартості шаблону Micro Fro...
OdessaJS Conf
 
PDF
Павло Галушко. GOOD CODE MYTHS. OdessaJS'2021
OdessaJS Conf
 
PPTX
"NODEJS & GRAPHQL COOKBOOK. LET’S TALK ABOUT MICRO-SERVICES" by Антон Чередні...
OdessaJS Conf
 
PPTX
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
OdessaJS Conf
 
PPTX
'IS THERE JAVASCRIPT ON SWAGGER PLUGINS?' by Dmytro Gusev
OdessaJS Conf
 
PPTX
'ETHEREUM SMART CONTRACTS ON JS' by Yaroslav Dvorovenko
OdessaJS Conf
 
PPTX
'GOLANG USAGE IN DEVELOPMENT OF NODE.JS APPLICATIONS (NODE.JS: IN GO WE TRUST...
OdessaJS Conf
 
PPTX
'MICROFRONTENDS WITH REACT' by Liliia Karpenko
OdessaJS Conf
 
PDF
'Web performance metrics' BY ROMAN SAVITSKYI at OdessaJS'2020
OdessaJS Conf
 
PDF
'STORY OF ANOTHER ANIMATION' by YURII ARTYUKH at OdessaJS'2020
OdessaJS Conf
 
PDF
'JavaScript was invented in Odessa' by DMITRIY GUSEV at OdessaJS'2020
OdessaJS Conf
 
PDF
'Why svelte' by BORYS MOHYLA at OdessaJS'2020
OdessaJS Conf
 
PDF
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
OdessaJS Conf
 
PDF
'Tensorflow.js in real life' by Pavlo Galushko at OdessaJS'2020
OdessaJS Conf
 
'GraphQL Schema Design' by Borys Mohyla. OdessaJS'2021
OdessaJS Conf
 
'How i came up with my talk' by Yurii Artiukh. OdessaJS'2021
OdessaJS Conf
 
"Is there life in react without redux" by Babich Sergiy. OdessaJS'2021
OdessaJS Conf
 
Олексій Павленко. CONTRACT PROTECTION ON THE FRONTEND SIDE: HOW TO ORGANIZE R...
OdessaJS Conf
 
Андрій Троян. Розробка мікросервісів з NestJS. OdessaJS'2021
OdessaJS Conf
 
Олексій Гончар "Використання Electron в розробці корпоративної відео-мессeндж...
OdessaJS Conf
 
Максим Климишин "Що такого особливого у пропозиції вартості шаблону Micro Fro...
OdessaJS Conf
 
Павло Галушко. GOOD CODE MYTHS. OdessaJS'2021
OdessaJS Conf
 
"NODEJS & GRAPHQL COOKBOOK. LET’S TALK ABOUT MICRO-SERVICES" by Антон Чередні...
OdessaJS Conf
 
'BUILDING ANGULAR APPS WITH NX' by Anastasia Necheporenko
OdessaJS Conf
 
'IS THERE JAVASCRIPT ON SWAGGER PLUGINS?' by Dmytro Gusev
OdessaJS Conf
 
'ETHEREUM SMART CONTRACTS ON JS' by Yaroslav Dvorovenko
OdessaJS Conf
 
'GOLANG USAGE IN DEVELOPMENT OF NODE.JS APPLICATIONS (NODE.JS: IN GO WE TRUST...
OdessaJS Conf
 
'MICROFRONTENDS WITH REACT' by Liliia Karpenko
OdessaJS Conf
 
'Web performance metrics' BY ROMAN SAVITSKYI at OdessaJS'2020
OdessaJS Conf
 
'STORY OF ANOTHER ANIMATION' by YURII ARTYUKH at OdessaJS'2020
OdessaJS Conf
 
'JavaScript was invented in Odessa' by DMITRIY GUSEV at OdessaJS'2020
OdessaJS Conf
 
'Why svelte' by BORYS MOHYLA at OdessaJS'2020
OdessaJS Conf
 
'Effective node.js development' by Viktor Turskyi at OdessaJS'2020
OdessaJS Conf
 
'Tensorflow.js in real life' by Pavlo Galushko at OdessaJS'2020
OdessaJS Conf
 
Ad

Recently uploaded (20)

PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PPTX
Q2 Leading a Tableau User Group - Onboarding
lward7
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Q2 Leading a Tableau User Group - Onboarding
lward7
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 

Modules and artifacts in NPM by Anton Cherednikov

  • 1. Modules and Artifacts in NPM ANTON CHEREDNIKOV Summer. Sea. JavaScript.
  • 2. Agenda ● Artifacts and Modules ● why? ● decomposition ● examples ● “best practices” ● publish ● Maintain modules without pain ● audit, versioning, dependencies, expectations... ● Registry ● issues, public/private registry, alternatives... ● CI / CD
  • 3. Why? ● Isolating components that are duplicated: ○ service core library ○ logs ○ utils ○ db models ● Own corporate / project standards ● Flexibility in development ● Using the advantages of versioning convenience
  • 4. Decomposition ● Libraries provide a way to share functionality with different teams and services. ● (!) Shared code can be a point, which will create an dependencies between services (ex .: ORM DB models) ● Service-core library: an approach that allows you to create some kind of standards for your micro-services
  • 8. Publish ● configure package.json ● describe README.MD ● set default credentials: $ npm adduser / npm login ● tap $ npm publish ● enjoy: $ npm i %package_name%
  • 10. Audit ● review your package: $ npm publish --dry-run ● or just use $ npm pack to see result ● describe the entries to be included when your package is installed as a dependency, use files property (package.json) ● take care of your dependencies: $npm audit/outdated
  • 11. Semantic Versioning ● MAJOR version when you make incompatible API changes ● MINOR version when you add functionality in a backwards-compatible manner ● PATCH version when you make backwards-compatible bug fixes.
  • 12. Dependencies ● ^version “Compatible with version” (by default: $ npm i %package_name%) ● version Must match version exactly ● ~version - Approximately equivalent to version ● >version Must be greater than version ○ >=version ○ <version ○ <=version ● * Matches any version
  • 13. Expectations ● Any project structure ● Description required (wiki, REAME.MD) ● Tests - is a must ○ coverage control ○ reports ○ automated ● Use the advantages of versioning ● All that can be automated - should be automated
  • 14. Registry Motivation to use private registry
  • 15. Issues ● Public registry returns 404 for a package installed before ● https://status.npmjs.org/ ● https://status.yarnpkg.com/ ● Many packages suddenly disappeared (all dependencies of webpack-related modules): ● https://www.npmjs.com/package/infinity-agent ● https://www.npmjs.com/package/timed-out ● https://www.npmjs.com/package/pinkie-promise ● https://www.npmjs.com/package/require-from-string ● …
  • 18. left-pad Left-pad module - is an example of unexpected behavior of public registry. 23 March 2018: React, Babel, and a bunch of other popular NPM packages broke. A simple NPM package called left-pad was installed as a dependency in React, Babel, and other packages. The owner just remove it from npm. RIP. Azer Koçulu - left-pad creator left-pad: O(N^2)
  • 20. Public and private registry ● default: registry.npmjs.org ● public (may do anything with any dependencies) ● private: ○ MyGet (https://www.myget.org) —which costs US$ 9/month for starter plan and you only would have 2 contributors and 1GB storage ○ NPMJS.COM (https://www.npmjs.com) — which costs US$ 7 per user per month. (Organize packages and teams into permissions groups) ○ * Custom solution
  • 21. Alternative ● npm install --save username/repo#branch-name ● Static repository url ● Authentication required ● Private repository: IP whitelist config required ● We don’t use registry
  • 22. ● If you want to use all benefits of npm package system in your company without sending all code to the public, and use your private packages just as easy as public ones. ● Out of the box with its own database ● Caching the downloaded modules ● Mirroring (proxy) other registries ● Secure. Supported npm/yarn audit ● Supported Installing packages (npm install, npm upgrade) and publishing packages (npm publish) simple, zero-config-required local private npm registry https://github.com/verdaccio/verdaccio $ npm install --global verdaccio $ npm set registry http://YOUR_DOMAIN.COM/ $ npm publish --registry http://YOUR_DOMAIN.COM/
  • 23. ● Full support for managing npm packages and ensures optimal and reliable access to npmjs.org ● Mirroring (proxy) ● Aggregating: access to multiple npm registries from a single URL. (overcomes the limitation of the npm client which can only access a single registry at a time) ● Assign access privileges according to projects or development teams.
  • 25. CI CD
  • 26. npm ci ● NPM 5.7.0 introduced the new npm ci command ● it’s faster — some report a 2–5x speed improvement of their CI ● it only considers package-lock.json (make sure the file is checked in) ● it never updates package.json or package-lock.json ● it throws away existing node_modules and starts with a clean slate $ npm install added 184 packages in 12.103s $ npm ci added 184 packages in 5.922s * use it when you cook your container
  • 28. Basic CI/CD flow ● unit tests - run on each commit. Quality control. ● manual publish - publish npm module to artifactory. Manual action. Appends a prefix to the artifact name ● manual unpublish - remove npm module from artifactory ● autopublish - triggered only when changes were merged in master. Publish npm module to artifactory without any prefixes
  • 30. Summary ● Choose the right solution for each individual situation (git dependency, public/private registry, registry provider...) ● Avoid public registry ● Audit your packages (versioning, dependencies, scheduled checks…) ● Collect old artifacts ● Build process of deployment your npm modules with a team (example: prefix for development modules, publish/unpublish package terms) ● All that can be automated - should be automated: CI / CD