SlideShare a Scribd company logo
1 of 23
Download to read offline
Modularizing your JavaScript development 
Ruy Adorno | @ruyadorno
Monolithic applications 
• Huge unmaintainable chunks of code 
• Anti-pattern
Modularizing 
• Identify reusable blocks 
• Create small modules 
• Smaller modules are easier to 
maintain and can be reused later!
Package Managers 
• Tool that automates the process of installing, 
uninstalling and updating software packages 
• Provides a standard way of managing 
dependencies 
• Managing files manually is an extremely error-prone 
task
Why npm? 
• Recently got a $2.6M funding 
• Announced they want to be a part of the 
Front-end ecosystem
Differences between
Module definitions 
• Make code reusable 
• ES6 modules are still not there yet 
• npm supports any module format
Global namespaces
CommonJS
AMD
UMD
Frameworks 
• Have their own modules definitions 
• Directives and Services are great for reuse 
when working with AngularJS
New technologies 
web components
MODULARIZE 
ALL THE THINGS
npm install
npm init
Automating tasks 
• Yeoman is great for starting any new structure 
• Grunt is the most popular JavaScript task runner
Reusing 
third-party 
modules
Share your 
Modules!
Merci! 
@ruyadorno 
http://ruyadorno.com
Image Credits 
- Paint all the memes by Sam Spratt: http://samspratt.com/ 
- Monolith III by Tim Jarvis: http://www.magnasoma.co.uk/#/monolith-3 
- Lego Color Bricks by Alan Chia: http://commons.wikimedia.org/wiki/File:Lego_Color_Bricks.jpg 
- Go Gopher packages photo by Nathan Youngman: http://nathany.com/go-packages/ 
- Pattern tiles by Toni F: https://www.flickr.com/photos/st-lite/2660966951 
- Pile of Kittens by Peter Hasselbom: https://www.flickr.com/photos/peter_hasselbom/3072326220 
- Kitten k3 by Kubilay Ozvardar: https://www.flickr.com/photos/mrkubi/1222735107
References 
- npm Official Website: http://npmjs.org/ 
- npm Official Blog: http://blog.npmjs.org/ 
- Package management system: http://en.wikipedia.org/wiki/Package_management_system 
- Not Invented here: http://en.wikipedia.org/wiki/Not_invented_here 
- npm Install: https://www.npmjs.org/doc/cli/npm-install.html 
- npm Publish: https://www.npmjs.org/doc/cli/npm-publish.html 
- Bower API: http://bower.io/docs/api/ 
- CommonJS: http://www.commonjs.org/ 
- Browserify: http://browserify.org/ 
- Node.js modules Doc: http://nodejs.org/api/modules.html 
- AMD: https://github.com/amdjs/amdjs-api 
- RequireJS: http://requirejs.org/ 
- UMD: https://github.com/umdjs/umd 
- Bower.json spec: https://github.com/bower/bower.json-spec 
- npm package.json spec: https://www.npmjs.org/doc/files/package.json.html 
- AngularJS: https://angularjs.org/ 
- Web components: http://webcomponents.org/ 
- Mout and modularity: http://blog.millermedeiros.com/mout-and-modularity/ 
- Substack opinions on modules: http://substack.net/how_I_write_modules 
- Death to monolithic libraries by Cedric Dugas: http://www.position-absolute.com/articles/death-to-monolithic-libraries/

More Related Content

Similar to npm: Modularizing your JavaScript development

TriplePlay-WebAppPenTestingTools
TriplePlay-WebAppPenTestingToolsTriplePlay-WebAppPenTestingTools
TriplePlay-WebAppPenTestingToolsYury Chemerkin
 
Esug java
Esug javaEsug java
Esug javaESUG
 
Have we forgotten how to program? - Tunisian WebDev MeetUp
Have we forgotten how to program? - Tunisian WebDev MeetUpHave we forgotten how to program? - Tunisian WebDev MeetUp
Have we forgotten how to program? - Tunisian WebDev MeetUpBedis ElAchèche
 
Meteor node upnorth-bobdavies
Meteor node upnorth-bobdaviesMeteor node upnorth-bobdavies
Meteor node upnorth-bobdaviesMark Skeet
 
Mind your App Footprint 🐾⚡️🌱 (@FlutterConn 2023)
Mind your App Footprint 🐾⚡️🌱 (@FlutterConn 2023)Mind your App Footprint 🐾⚡️🌱 (@FlutterConn 2023)
Mind your App Footprint 🐾⚡️🌱 (@FlutterConn 2023)François
 
OSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java application
OSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java applicationOSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java application
OSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java applicationNicolas Fränkel
 
Make Their Short Film By Loris Greaud
Make Their Short Film By Loris GreaudMake Their Short Film By Loris Greaud
Make Their Short Film By Loris GreaudLoris Greaud
 
Explain and provide example when it is possible that will cover chap.docx
Explain and provide example when it is possible that will cover chap.docxExplain and provide example when it is possible that will cover chap.docx
Explain and provide example when it is possible that will cover chap.docxrhetttrevannion
 
How we built a tools stack for the benchmarking AI and what happened next
How we built a tools stack for the benchmarking AI and what happened nextHow we built a tools stack for the benchmarking AI and what happened next
How we built a tools stack for the benchmarking AI and what happened nextMichal Lukaszewski
 
NetworkX - python graph analysis and visualization @ PyHug
NetworkX - python graph analysis and visualization @ PyHugNetworkX - python graph analysis and visualization @ PyHug
NetworkX - python graph analysis and visualization @ PyHugJimmy Lai
 
Developing for Mobile
Developing for MobileDeveloping for Mobile
Developing for MobileRemy Sharp
 
ITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game development
ITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game developmentITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game development
ITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game developmentITCamp
 
01 introduction to cloud computing technology
01 introduction to cloud computing technology01 introduction to cloud computing technology
01 introduction to cloud computing technologyNan Sheng
 
北航云计算公开课01 introduction to cloud computing technology
北航云计算公开课01 introduction to cloud computing technology北航云计算公开课01 introduction to cloud computing technology
北航云计算公开课01 introduction to cloud computing technologyyhz87
 
The Windows Developer User Group - Sep 2012 Meetup
The Windows Developer User Group - Sep 2012 MeetupThe Windows Developer User Group - Sep 2012 Meetup
The Windows Developer User Group - Sep 2012 MeetupSam Basu
 
Living system or build factory - Chris Maxwell
Living system or build factory  - Chris MaxwellLiving system or build factory  - Chris Maxwell
Living system or build factory - Chris MaxwellDevopsdays
 

Similar to npm: Modularizing your JavaScript development (20)

TriplePlay-WebAppPenTestingTools
TriplePlay-WebAppPenTestingToolsTriplePlay-WebAppPenTestingTools
TriplePlay-WebAppPenTestingTools
 
Jchem Paint
Jchem PaintJchem Paint
Jchem Paint
 
Esug java
Esug javaEsug java
Esug java
 
Mobile WPO
Mobile WPOMobile WPO
Mobile WPO
 
Have we forgotten how to program? - Tunisian WebDev MeetUp
Have we forgotten how to program? - Tunisian WebDev MeetUpHave we forgotten how to program? - Tunisian WebDev MeetUp
Have we forgotten how to program? - Tunisian WebDev MeetUp
 
Nuxeo Iks 2009 11 13
Nuxeo Iks 2009 11 13Nuxeo Iks 2009 11 13
Nuxeo Iks 2009 11 13
 
Meteor node upnorth-bobdavies
Meteor node upnorth-bobdaviesMeteor node upnorth-bobdavies
Meteor node upnorth-bobdavies
 
Mind your App Footprint 🐾⚡️🌱 (@FlutterConn 2023)
Mind your App Footprint 🐾⚡️🌱 (@FlutterConn 2023)Mind your App Footprint 🐾⚡️🌱 (@FlutterConn 2023)
Mind your App Footprint 🐾⚡️🌱 (@FlutterConn 2023)
 
OSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java application
OSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java applicationOSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java application
OSCONF Jaipur - A Hitchhiker's Tour to Containerizing a Java application
 
final proposal-yum
final proposal-yumfinal proposal-yum
final proposal-yum
 
Make Their Short Film By Loris Greaud
Make Their Short Film By Loris GreaudMake Their Short Film By Loris Greaud
Make Their Short Film By Loris Greaud
 
Explain and provide example when it is possible that will cover chap.docx
Explain and provide example when it is possible that will cover chap.docxExplain and provide example when it is possible that will cover chap.docx
Explain and provide example when it is possible that will cover chap.docx
 
How we built a tools stack for the benchmarking AI and what happened next
How we built a tools stack for the benchmarking AI and what happened nextHow we built a tools stack for the benchmarking AI and what happened next
How we built a tools stack for the benchmarking AI and what happened next
 
NetworkX - python graph analysis and visualization @ PyHug
NetworkX - python graph analysis and visualization @ PyHugNetworkX - python graph analysis and visualization @ PyHug
NetworkX - python graph analysis and visualization @ PyHug
 
Developing for Mobile
Developing for MobileDeveloping for Mobile
Developing for Mobile
 
ITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game development
ITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game developmentITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game development
ITCamp 2011 - Catalin Zima - Common pitfalls in Windows Phone 7 game development
 
01 introduction to cloud computing technology
01 introduction to cloud computing technology01 introduction to cloud computing technology
01 introduction to cloud computing technology
 
北航云计算公开课01 introduction to cloud computing technology
北航云计算公开课01 introduction to cloud computing technology北航云计算公开课01 introduction to cloud computing technology
北航云计算公开课01 introduction to cloud computing technology
 
The Windows Developer User Group - Sep 2012 Meetup
The Windows Developer User Group - Sep 2012 MeetupThe Windows Developer User Group - Sep 2012 Meetup
The Windows Developer User Group - Sep 2012 Meetup
 
Living system or build factory - Chris Maxwell
Living system or build factory  - Chris MaxwellLiving system or build factory  - Chris Maxwell
Living system or build factory - Chris Maxwell
 

Recently uploaded

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 

Recently uploaded (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

npm: Modularizing your JavaScript development

  • 1. Modularizing your JavaScript development Ruy Adorno | @ruyadorno
  • 2. Monolithic applications • Huge unmaintainable chunks of code • Anti-pattern
  • 3. Modularizing • Identify reusable blocks • Create small modules • Smaller modules are easier to maintain and can be reused later!
  • 4. Package Managers • Tool that automates the process of installing, uninstalling and updating software packages • Provides a standard way of managing dependencies • Managing files manually is an extremely error-prone task
  • 5. Why npm? • Recently got a $2.6M funding • Announced they want to be a part of the Front-end ecosystem
  • 7. Module definitions • Make code reusable • ES6 modules are still not there yet • npm supports any module format
  • 10. AMD
  • 11. UMD
  • 12. Frameworks • Have their own modules definitions • Directives and Services are great for reuse when working with AngularJS
  • 13. New technologies web components
  • 17.
  • 18. Automating tasks • Yeoman is great for starting any new structure • Grunt is the most popular JavaScript task runner
  • 22. Image Credits - Paint all the memes by Sam Spratt: http://samspratt.com/ - Monolith III by Tim Jarvis: http://www.magnasoma.co.uk/#/monolith-3 - Lego Color Bricks by Alan Chia: http://commons.wikimedia.org/wiki/File:Lego_Color_Bricks.jpg - Go Gopher packages photo by Nathan Youngman: http://nathany.com/go-packages/ - Pattern tiles by Toni F: https://www.flickr.com/photos/st-lite/2660966951 - Pile of Kittens by Peter Hasselbom: https://www.flickr.com/photos/peter_hasselbom/3072326220 - Kitten k3 by Kubilay Ozvardar: https://www.flickr.com/photos/mrkubi/1222735107
  • 23. References - npm Official Website: http://npmjs.org/ - npm Official Blog: http://blog.npmjs.org/ - Package management system: http://en.wikipedia.org/wiki/Package_management_system - Not Invented here: http://en.wikipedia.org/wiki/Not_invented_here - npm Install: https://www.npmjs.org/doc/cli/npm-install.html - npm Publish: https://www.npmjs.org/doc/cli/npm-publish.html - Bower API: http://bower.io/docs/api/ - CommonJS: http://www.commonjs.org/ - Browserify: http://browserify.org/ - Node.js modules Doc: http://nodejs.org/api/modules.html - AMD: https://github.com/amdjs/amdjs-api - RequireJS: http://requirejs.org/ - UMD: https://github.com/umdjs/umd - Bower.json spec: https://github.com/bower/bower.json-spec - npm package.json spec: https://www.npmjs.org/doc/files/package.json.html - AngularJS: https://angularjs.org/ - Web components: http://webcomponents.org/ - Mout and modularity: http://blog.millermedeiros.com/mout-and-modularity/ - Substack opinions on modules: http://substack.net/how_I_write_modules - Death to monolithic libraries by Cedric Dugas: http://www.position-absolute.com/articles/death-to-monolithic-libraries/