Software Registries

Abel Sanchez and John R. Williams

Software Platform

.NET

Java

Others?

Software Distribution

App Store

Google Play

Others?

Software Registry

npm

Others?

Sign Up

https://www.npmjs.com/signup

Login to NPM


					$ npm login
					

Let's Create a New Package

Let's start by creating a new directory


					$ mkdir newdir
					

					$ cd newdir
					

Add Some Code

Let's add a greeting function


					exports.greeting = function(){
						console.log('Hello World!');
					};
					

Add Metadata

Use npm's init to generate metadata


					$ npm init
					

Sample Metadata

Sample package.json file


					{
					  "name": "newdir",
					  "version": "1.0.0",
					  "description": "simple greeting function",
					  "main": "index.js",
					  "scripts": {
					    "test": "echo \"Error: no test specified\" && exit 1"
					  },
					  "author": "abel@mit.edu",
					  "license": "MIT"
					}
					

Publish to NPM

Push code to registry


					$ npm publish
					

Confirm Code Is Live

https://www.npmjs.com/~YourNpmUsername

Active Learning

Consume module published by classmate