greet-name-package
v1.0.1
Published
`greet-name-package` is a simple npm package that provides a greeting function. It returns a friendly "Hello" message and can greet a user by name.
Downloads
18
Readme
greet-name-package
greet-name-package
is a simple npm package that provides a greeting function. It returns a friendly "Hello" message and can greet a user by name.
Installation
To install the package, use npm:
npm install greet-name-package
Usage
Here's how you can use the greet
function in your project:
// Import the greet function
const greet = require('greet-name-package');
// Usage examples
console.log(greet()); // Output: "Hello"
console.log(greet('Himanshu')); // Output: "Hello, Himanshu!"
Function Signature
greet(name = "")
name
(string): The name of the person to greet. If thename
is not provided or is an empty string, the function will return a generic greeting:"Hello"
.
Features
- Returns a generic greeting if no name is provided.
- Returns a personalized greeting if a name is given.
Contributing
Contributions are welcome! If you find any issues or have ideas for improvements, please open an issue or submit a pull request on the GitHub repository.
License
This project is licensed under the MIT License.