Sharing modules in modern web applications
Juan Picado
Node.js Meetup
June 4th 2019
Juan Picado
• Front-End Engineer at Mobfox
• Maintainer at Verdaccio
• 🚚 Vienna 🇦🇹 -> Berlin 󾓨
• @jotadeveloper
You are missing a lot
How a modern JS project looks like?
yarn, pnpm or npm orchestrate the distribution
https://twitter.com/ismonkeyuser/status/882117941344567296
Your code is just small part of your Application
https://twitter.com/liran_tal/status/1067775376229834754
A modern application is highly modularized
https://www.youtube.com/watch?v=vypCsVm5z28
All packages
come from
the registry
https://twitter.com/bitandbang/status/1134872073896169472
Javascript is the most collaborative ecosystem
npmjs registry
https://www.youtube.com/watch?v=QtChaxbsw7U
SHARE
Link a package is not a real publish
Link a package is not a real publish
yarn berry (v2)
seems to fix
it
npm pack
npm install ./tarball.tar.gz
A classic
Follow Semantic Versioning
https://semver.org/
Microsharing
Publishing
Where to publish?
Self Hosted SaaS
💰💰
💰
💰💰
SaaS uses volumed based pricing
FOSS
Spam detection
A lightweight private npm proxy registry
Verdaccio is a lightweight proxy and private
registry with an entirely optional configuration that
allows you to host private Node.js packages and is
compatible with all client package managers such
npm, Yarn or pnpm.
Installation
node >8
Docker and Kubernetes
4.400.000 pulls
https://github.com/verdaccio/docker-examples
CLI
Case Study
“We ran the math, npm charges
$7/customer/mo and every user has to have a
paid account; verdaccio can effortlessly scale to
hundreds of users and tens of packages a month”
“We use it in production on a single
DigitalOcean droplet, $5/mo”
https://sheetjs.com/
Demo
Verdaccio 4
is here !!
Verdaccio 4
• New User Interface (React)
• Change Password
• New permission: unpublish
• JWT support
• New npm commands (star, profile)
• Drop Node.js 6
Documentation
https://verdaccio.org
Contributors
10 npm Security Best Practices
https://snyk.io/blog/ten-npm-security-best-practices/
Liran Tal @liran_tal
Developer Advocate @snyksec | @NodeJS
Security WG | @TheSecureDev team
https://www.thesecuredeveloper.com/
Keep in Touch
• http://chat.verdaccio.org
• https://twitter.com/verdaccio_npm
• https://github.com/verdaccio
Donate
Open Source must be sustainable
https://opencollective.com/verdaccio
https://es.slideshare.net/juancarlospicado
Thanks

Sharing modules in modern web applications