Building node.js Modules
Kevin Griffin
CodeMash 2.0.1.5
Kevin Griffin
Independent Consultant.
Bootstrapper.
All around nice guy.
kevin@kevgriffin.com
twitter.com/1kevgriff
Simple Windows Server Monitoring
14-day Free Trial
http://winsitter.com
http://wintellectnow.com
Promo Code: GRIFFIN-13
Giveaway!
1) 1 annual subscription
2) Beats by Dr. Dre Earbuds
Text “NODE” to
(567) 998-4644
What are modules?
Why modules?
Package Managers
npmjs.org
Three types of modules
require(‘myModule’)
require(‘./myFile’)
require(‘./myFile.js’)
or
require(‘./myFile.json’)
require(‘./myFolder’)
require(‘./myFolder/index.js’)
Demo:
Road to Module
Independence
Getting Setup to
Publish to npm
1.Create new user account at npmjs.org
2.Go to terminal/command prompt
npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com“
npm adduser
npm init
npm publish
npm publish
And let there be
code…
Thanks for attending!
Kevin Griffin
kevin@kevgriffin.com
twitter.com/1kevgriff
http://bit.ly/GriffDevLink1

Codemash - Building Custom node.js Modules