Scripting with NodeJS

1,435 views

Published on

Presented at MelbJS (Melbourne Javascript Meetup) on 11th Apri

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,435
On SlideShare
0
From Embeds
0
Number of Embeds
478
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Scripting with NodeJS

    1. 1. Scripting with NodeJS Ben Pearson - @benjaminpearson
    2. 2. Most of the time I develop with Objective C.... ...quite different to the clean syntax of JavaScript
    3. 3. Scripting• Automating tasks• Command line utilities• Macros• Scraping websites• Shell, Python, PHP, Ruby
    4. 4. NodeJS• Built on V8 engine• Run JavaScript outside of browser• Fast, non-blocking / asynchronous, lightweight• Its JavaScript, for realz!
    5. 5. npm - Package Manager for Node• Super easy• Search, install and update packages• http://npmjs.org/
    6. 6. Getting Started• git clone https://github.com/visionmedia/n.git• cd n• sudo make install• sudo n stableLatest versions of node come with npm, if you are having issues you can try• curl http://npmjs.org/install.sh | sudo sh* note: ideally its best not to use `sudo` so cavalier, there are alternative methods, but this is simple.
    7. 7. Code Example• Youtube• Command line args • process.argv • commander.js• Bin it
    8. 8. Code Example• Radar / Ping• Cron• Growl notifications• Daemonize
    9. 9. Code Example• Visual Rent• Web scraping with jQuery (sizzle selectors)• Express• fs• MongoDB
    10. 10. Moaaar Modules• npmjs.org - search modules• Node modules wiki page
    11. 11. What would MacGyver Do? Script with NodeJS
    12. 12. Thank you

    ×