kadit-components-packages
v1.0.0
Published
A sample public NPM package with React components - Tutorial example
Maintainers
Readme
tutorial-awesome-utils
A sample public NPM package with utility functions. Created for the NPM Package Publishing Tutorial.
Installation
npm install tutorial-awesome-utilsBefore publishing: Rename this package in
package.jsonto a unique name (e.g.,my-awesome-utils-yourname). Check availability at https://www.npmjs.com/package/your-name
Usage
const { greet, add, formatDate, slugify } = require('tutorial-awesome-utils');
// Greet someone
console.log(greet('Alice'));
// => "Hello, Alice! Welcome to your first public NPM package."
// Add numbers
console.log(add(10, 5));
// => 15
// Format date
console.log(formatDate(new Date()));
// => "2024-01-15T12:00:00.000Z"
// Create URL slug
console.log(slugify('My Awesome Post!'));
// => "my-awesome-post"API
| Function | Description |
|----------|-------------|
| greet(name) | Returns a greeting message |
| add(a, b) | Adds two numbers |
| formatDate(date) | Returns ISO date string |
| slugify(text) | Converts text to URL-friendly slug |
License
MIT
