Skip to content

nautilus-wraith/publish-npm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@nautilus/hello-world

A simple hello world NPM package for demonstration purposes.

Local Development

  1. Clone the repository:
git clone https://github.com/nautilus/publish-npm.git
cd publish-npm
  1. Install dependencies:
npm install
  1. Run tests:
npm test

Testing Locally

To test the package locally without publishing to npm:

  1. In the package directory, create a symlink:
npm link
  1. In your test project directory, link to the package:
npm link @nautilus/hello-world
  1. Now you can use the package in your test project:
const { sayHello } = require('@nautilus/hello-world');

console.log(sayHello()); // Outputs: Hello, World!
console.log(sayHello('John')); // Outputs: Hello, John!
  1. When you're done testing, unlink the package:

    a. In your test project directory:

    npm unlink @nautilus/hello-world

    b. In the package directory:

    npm unlink

Installation (After Publishing)

Once published, you can install the package using:

npm install @nautilus/hello-world

Usage

const { sayHello } = require('@nautilus/hello-world');

console.log(sayHello()); // Outputs: Hello, World!
console.log(sayHello('John')); // Outputs: Hello, John!

Test packaging before publishing

npm pack --dry-run

Installation

  • builds node_modules

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 5