@nautilus-wraith/hello-world
v1.0.3
Published
A simple hello world NPM package
Downloads
7
Readme
@nautilus/hello-world
A simple hello world NPM package for demonstration purposes.
Local Development
- Clone the repository:
git clone https://github.com/nautilus/publish-npm.git
cd publish-npm- Install dependencies:
npm install- Run tests:
npm testTesting Locally
To test the package locally without publishing to npm:
- In the package directory, create a symlink:
npm link- In your test project directory, link to the package:
npm link @nautilus/hello-world- 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!When you're done testing, unlink the package:
a. In your test project directory:
npm unlink @nautilus/hello-worldb. In the package directory:
npm unlink
Installation (After Publishing)
Once published, you can install the package using:
npm install @nautilus/hello-worldUsage
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-runInstallation
- builds
node_modules
