1.0.0 • Published 9 months ago

@rent-a-store/hello-world-package v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Hello World Package

A simple demonstration package for learning npm publishing.

Installation

npm install @yourorganization/hello-world-package

Usage

ES Modules

import { hello, greet, createGreeting } from '@yourorganization/hello-world-package';

console.log(hello()); // "Hello, World!"
console.log(greet('Alice')); // "Hello, Alice!"

CommonJS

const { hello, greet, createGreeting } = require('@yourorganization/hello-world-package');

console.log(hello()); // "Hello, World!"
console.log(greet('Bob')); // "Hello, Bob!"

Advanced Usage

import { createGreeting } from '@yourorganization/hello-world-package';

const greeting = createGreeting({
  name: 'Developer',
  punctuation: '.',
  uppercase: true
});

console.log(greeting); // "HELLO, DEVELOPER."

API

hello()

Returns a simple "Hello, World!" greeting.

greet(name: string)

Returns a personalized greeting for the given name.

createGreeting(options: GreetingOptions)

Creates a customized greeting with the following options:

  • name?: string - Name to greet (default: "World")
  • punctuation?: string - Ending punctuation (default: "!")
  • uppercase?: boolean - Whether to return uppercase text (default: false)

Development

# Install dependencies
npm install

# Build the package
npm run build

# Run tests
npm test

# Watch mode for development
npm run dev

License

MIT

1.0.0

9 months ago