Steps to create NPM Package and upload on NPM Server.

Ramesh Chavan
2 min readNov 6, 2017

// Create directory
1: mkdir TestDemoPackage

2: cd TestDemoPackage
// Init NPM Project
3: npm init

H:>mkdir TestDemoPackage

H:>cd TestDemoPackage

H:>npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help json` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg> -save` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
name: (TestDemoPackage) chavanramesh_react_native_testpackage_5
Sorry, name can no longer contain capital letters.
name: (TestDemoPackage) chavanramesh-testpackage
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords: test
author: Ramesh Chavan <r******an@gmail.com> (http://www.rameshchavan.in/)
license: (ISC)
About to write to package.json
:

{
“name”: “chavanramesh_react_native_testpackage_5”,
“version”: “1.0.0”,
“description”: “”,
“main”: “index.js”,
“scripts”: {
“test”: “echo \”Error: no test specified\” && exit 1″
},
“keywords”: [
“test”
],
“author”: “R**sh C***n <r******an@gmail.com> (http://www.rameshchavan.i
n/)”,
“license”: “ISC”
}
Is this ok? (yes) yes

H:\Development\ReactNative\Module\TestDemoPackage>

//Publish NPM package and you have to must login with npm credentials

H:\Development\ReactNative\Module\TestDemoPackage>npm publish
+ chavanramesh-testpackage@1.0.0

//Now the package available to download for everyone with the following command
6: npm install -save chavanramesh_react_native_testpackage_5

//Link module

7: npm link chavanramesh_react_native_testpackage_5

Example : https://www.npmjs.com/package/chavanramesh_react_native_testpackage_5

Originally published at http://www.rameshchavan.in on November 6, 2017.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Ramesh Chavan
Ramesh Chavan

Written by Ramesh Chavan

Like to work on iOS, Android, UIPath and Graph DB

No responses yet

Write a response