O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Instant Node Package Module

Book Description

Create your own node modules and publish them on npm registry, automating repetitive tasks in between

  • Learn something new in an Instant! A short, fast, focused guide delivering immediate results
  • Create and distribute node modules
  • Learn how to publish executables
  • Automate the installation of dependencies

In Detail

Node.js is the new buzz in town and has a vibrant community.It ships with npm, which is a tool that helps automate various development, deployment, and installation of node modules, and makes the process much easier.

Instant NPM is a practical guide to authoring and distributing node modules, and also for creating and managing private, standalone node.js projects.

Starting with getting node.js installed and running on a variety of platforms, we then proceed to learn about code modularization and achieving it in node.js. Picking up a practical example, we will then explore the whole process and life cycle of conceiving, writing, and publishing a node module. We will also learn how to exploit a toolsincluded with npm to automate various development and deployment steps.

Later on, we will discover the power of npm and how its different features and configurations can save large amounts of time by providing a helping hand for automating repetitive tasks between writing and publishing your modules.

Table of Contents

  1. Instant Node Package Manager
    1. Instant Node Package Manager
    2. Credits
    3. About the Author
    4. Acknowledgement
    5. About the Reviewer
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers and more
    7. PacktLib.PacktPub.com
      1. Why Subscribe?
      2. Free Access for Packt account holders
    8. 1. Instant Node Package Manager
      1. So, what is Node Package Manager?
      2. Installation
        1. Step 1 – what do I need?
        2. Step 2 – downloading node.js
          1. Windows or Mac
            1. Step 1 – downloading Windows/MAC installer
            2. Step 2 – running the installer
            3. Step 3 – testing
          2. Linux and other Unices
            1. One step installation
            2. Foolproof installation
              1. Step 1 – getting the binary
              2. Step 2 – extracting the file
              3. Step 3 – testing
              4. Step 4 – symlink
              5. Step 5 – testing symlink
          3. Installing via nvm and nave (recommended)
          4. Building and installing from source
        3. And that's it!
      3. Quick start – creating your first npm module
        1. simplemath library
          1. Step 1 – learning to use require()
            1. Native modules
            2. Importing folders
            3. require cache
          2. Step 2 – writing tests
          3. Step 3 – writing the actual code
          4. Step 4 – writing the glue code
          5. Step 5 – creating package.json
          6. Step 6 – adding dependencies
            1. The node_modules folder
          7. Step 7 – publishing
            1. Register and login
            2. Publish
      4. Top 10 features you need to know about
        1. Tag
        2. Install
          1. Related commands
        3. Binaries and global installs
          1. Related commands
        4. Linking
        5. .npmignore
          1. Global .npmignore
        6. Scripts
        7. Config
          1. Command-line flag
          2. Environment variables
          3. User config file
          4. Global config file
          5. Defaults
        8. Shrinkwrap
          1. Pruning
        9. Publishing
        10. Help
      5. People and places you should get to know
        1. Official sites
        2. Articles and tutorials
        3. Community
        4. Blogs
        5. Twitter