SlideShare a Scribd company logo
npm + browserify
First presented in 2009
Ryan Dahl, Joyent
Isaac Schlueter, Joyent
npm + browserify
+
Node v0.6.3 (2011-11-25)
https://blog.nodejitsu.com/npm-innovation-through-modularity/
https://blog.nodejitsu.com/npm-innovation-through-modularity/
http://www.modulecounts.com/
http://www.modulecounts.com/
Scaling issues?
http://nodejsreactions.tumblr.com/post/74396556262/the-npm-registry
#scalenpm
npmjs.eu
Hosted by Maciej Małecki at Hetzner, Germany
• npm.strongloop.com
• registry.nodejitsu.com
• registry.npmjs.org.au
• …
$ npm config set registry http://registry.npmjs.org
$ npm install --registry http://registry.npmjs.org
npm + browserify
npm, Inc.
2013
Technical details
• CommonJS Modules/1.0
• ~58’000 Modules
• Just a manager / downloader
• Not restricted to node.js / JavaScript
• Anarchic
• Only needs package.json
{
"name": "youtube-search",
"version": "0.0.3",
"description": "Search for youtube videos",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/MaxGfeller/youtube-search"
},
"keywords": [
"youtube",
"search",
"api"
],
"author": "Max Gfeller <max.gfeller@gmail.com>",
"license": "BSD",
"dependencies": {
"xml2js": "~0.2.8"
}
}
npm publish
npm + browserify
Advantages of small
packages
• No overhead
• Easier to replace
• Easier to create
• Easier to contribute
• Independent versioning
• Easier to break things
• Discoverability
• Demarcation
On the frontend side
npm + browserify
npm + browserify
npm + browserify
@substack
browser-side require() the node.js way
var foo = require('./foo');
var gamma = require('gamma');
!
var n = gamma(foo(5) * 3);
var txt = document.createTextNode(n);
document.body.appendChild(txt);
Example #1
browser versions of node
core libs
• events
• streams
• path
• url
• assert
• buffer
• util
• querystring
• http
• vm
• crypto
Example #2
Transforms
npm + browserify
Example #3
brfs
browserify fs.readFileSync() static asset inliner
Widget
images
CSS
JavaScript
Example #4
The „scripts“ field
{
[…]
"scripts": {
"prepublish": "git status",
"publish": "echo "Package published!"",
"install": "echo "Thanks for installing!"",
"test": "tap tests/test-*.js",
"start": "node app.js"
}
}
$ npm run publish
$ npm test
$npm start
{
"scripts": {
"watch-js": "watchify app.js --debug > bundle.js",
"watch-css": "catw styles/*.css > bundle.css",
"watch-dev": "npm run watch-js & npm run watch-css",
"build-js": "browserify app.js | uglifyjs -mc > bundle.js",
"build-css": "cat styles/*.css > bundle.css",
"start": "node app.js",
"start-dev": "npm run watch-dev & npm start"
}
}
Example #5
npm + browserify
Additional resources
• http://browserify.org
• https://github.com/substack/node-browserify
• http://substack.net
• https://twitter.com/browserify
Thanks!
@mgfeller

More Related Content

PDF
Jaap : node, npm & grunt
PPTX
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
PDF
open source product management (feat. npm)
PDF
Preprocessor Workflow with Grunt
PDF
Front-end development automation with Grunt
PDF
Modernizing Your WordPress Workflow with Grunt & Bower
PDF
The New Frontend Toolchain
PPTX
Introduction to using Grunt & Bower with WordPress theme development
Jaap : node, npm & grunt
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
open source product management (feat. npm)
Preprocessor Workflow with Grunt
Front-end development automation with Grunt
Modernizing Your WordPress Workflow with Grunt & Bower
The New Frontend Toolchain
Introduction to using Grunt & Bower with WordPress theme development

What's hot (20)

PPTX
A crash course in scaling wordpress
PDF
10 things you should know about django
PDF
Automate your WordPress Workflow with Grunt.js
PPTX
Build your own RasPiTV with Node.js & Socket.io
PPTX
Introduction to NodeJS
ODP
Version Controlling
PPTX
Deploy Node.js application in Heroku using Eclipse
PPTX
Grunt and Bower
PDF
Webinar - Matteo Manchi: Dal web al nativo: Introduzione a React Native
PPTX
Using nu get the way you should svcc
PDF
GDD HTML5, Flash, and the Battle for Faster Cat Videos
PDF
Improving WordPress Performance with Xdebug and PHP Profiling
PPTX
Ansible: What, Why & How
PDF
Netflix Nebula - Gradle Summit 2014
PDF
Development environment agile way
PDF
SF Gradle Meetup - Netflix OSS
PDF
Seravo.com: WordPress Security 101
PDF
Zero To Cloud (OSCon 2014)
PPTX
PHP Indonesia - Nodejs Web Development
A crash course in scaling wordpress
10 things you should know about django
Automate your WordPress Workflow with Grunt.js
Build your own RasPiTV with Node.js & Socket.io
Introduction to NodeJS
Version Controlling
Deploy Node.js application in Heroku using Eclipse
Grunt and Bower
Webinar - Matteo Manchi: Dal web al nativo: Introduzione a React Native
Using nu get the way you should svcc
GDD HTML5, Flash, and the Battle for Faster Cat Videos
Improving WordPress Performance with Xdebug and PHP Profiling
Ansible: What, Why & How
Netflix Nebula - Gradle Summit 2014
Development environment agile way
SF Gradle Meetup - Netflix OSS
Seravo.com: WordPress Security 101
Zero To Cloud (OSCon 2014)
PHP Indonesia - Nodejs Web Development
Ad

Viewers also liked (9)

PDF
Browserify
PDF
1st npm
PDF
Designing Modules for the Browser and Node with Browserify
PPTX
Don't Be Afraid of Abstract Syntax Trees
PDF
CommonJSの話
PDF
JavaScript Dependencies, Modules & Browserify
PDF
Desktop|Embedded Application API JSR
PDF
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
PDF
Modern UI Development With Node.js
Browserify
1st npm
Designing Modules for the Browser and Node with Browserify
Don't Be Afraid of Abstract Syntax Trees
CommonJSの話
JavaScript Dependencies, Modules & Browserify
Desktop|Embedded Application API JSR
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
Modern UI Development With Node.js
Ad

Similar to npm + browserify (20)

PPTX
Intro to Node.js (v1)
PDF
Introduccion Verdaccio ViennaJS
KEY
An Introduction to Node.js Development with Windows Azure
PDF
Node.js Crash Course
PDF
Tech io nodejs_20130531_v0.6
PPTX
Introduction to Verdaccio - Trivago 2019
PPSX
Node on Windows Azure
PDF
PaaSTA: Autoscaling at Yelp
PDF
Node.js Jump Start
PPTX
Fetch Company's statististics from Yahoo Finance and save it info a Google Sh...
PDF
Webinar: OpenStack Accelerates Software Development
PPTX
Mini-Training: Node.js
PPTX
KEY
Building production-quality apps with Node.js
PPTX
Intro To Node.js
PPTX
Introduction to Node.js
PDF
Modules and artifacts in NPM by Anton Cherednikov
PDF
Practical Node js Building Real World Scalable Web Apps 1st Edition Azat Mard...
PDF
Getting Started with Node.js
PDF
slide-dnrdw
Intro to Node.js (v1)
Introduccion Verdaccio ViennaJS
An Introduction to Node.js Development with Windows Azure
Node.js Crash Course
Tech io nodejs_20130531_v0.6
Introduction to Verdaccio - Trivago 2019
Node on Windows Azure
PaaSTA: Autoscaling at Yelp
Node.js Jump Start
Fetch Company's statististics from Yahoo Finance and save it info a Google Sh...
Webinar: OpenStack Accelerates Software Development
Mini-Training: Node.js
Building production-quality apps with Node.js
Intro To Node.js
Introduction to Node.js
Modules and artifacts in NPM by Anton Cherednikov
Practical Node js Building Real World Scalable Web Apps 1st Edition Azat Mard...
Getting Started with Node.js
slide-dnrdw

Recently uploaded (20)

PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Empathic Computing: Creating Shared Understanding
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Electronic commerce courselecture one. Pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Modernizing your data center with Dell and AMD
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPT
Teaching material agriculture food technology
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Chapter 3 Spatial Domain Image Processing.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Network Security Unit 5.pdf for BCA BBA.
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Empathic Computing: Creating Shared Understanding
NewMind AI Monthly Chronicles - July 2025
Electronic commerce courselecture one. Pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Modernizing your data center with Dell and AMD
Encapsulation_ Review paper, used for researhc scholars
Review of recent advances in non-invasive hemoglobin estimation
Spectral efficient network and resource selection model in 5G networks
Machine learning based COVID-19 study performance prediction
Understanding_Digital_Forensics_Presentation.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Teaching material agriculture food technology

npm + browserify