NPM Package
A simple utility package with basic functions for greeting, math operations, and string manipulation.
Installation
npm install npmpackage
Usage
const { greet, add, capitalize } = require('npmpackage');
console.log(greet('World'));
console.log(greet('Alice', 'Hi'));
console.log(add(5, 3));
console.log(capitalize('hello world'));
API
greet(name, greeting)
Greets a person with a customizable message.
name
(string): The name of the person to greet
greeting
(string, optional): Custom greeting message (default: "Hello")
Returns a formatted greeting string.
add(a, b)
Calculates the sum of two numbers.
a
(number): First number
b
(number): Second number
Returns the sum of the two numbers.
capitalize(str)
Capitalizes the first letter of each word in a string.
str
(string): The string to capitalize
Returns the capitalized string.
Testing
npm test
License
ISC
Author
arsh
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
)
- Commit your changes (
git commit -m 'Add some amazing feature'
)
- Push to the branch (
git push origin feature/amazing-feature
)
- Open a Pull Request