Building node.js Modules 
Kevin Griffin 
DevLink 2014
Kevin Griffin 
Independent Consultant. 
Bootstrapper. 
All around nice guy. 
kevin@kevgriffin.com 
twitter.com/1kevgriff
Stuff I Make 
@1kevgriff - kevgriffin.com
Like slides and code 
after the event?
http://bit.ly/ 
GriffDevLink1
Package Managers
npmjs.org
Three types of modules
require(‘./myFile’)
require(‘./myFile.js’) 
or 
require(‘./myFile.json’)
require(‘./myFolder’)
require(‘./myFolder/index.js’)
require(‘myModule’)
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

Building node.js Modules