@gloegg/package-demo-utils
v1.5.0
Published
A demo package for a monorepo setup with npm workspaces
Readme
package-demo-utils
A small demo package for our workshop. It provides a few lightweight utility functions for working with numbers and strings.
Features
- Math helpers such as
sumandavg - String helpers such as
reverse,greet, andcapitalize - Example package setup for publishing, testing, and commit hooks
Installation
Install the package from npm:
npm i @Gloegg/package-demo-utilsUsage
import { sum, avg, multiply } from "@Gloegg/package-demo-utils/src/math.js";
import { greet, capitalize } from "@Gloegg/package-demo-utils/src/string.js";
console.log(sum(1, 2, 3, 4)); // 10
console.log(multiply(1, 2, 3, 4)); // 24
console.log(avg(2, 4, 6)); // 4
console.log(greet("Workshop")); // Hello Workshop!
console.log(capitalize("demo")); // DemoDevelopment
Install dependencies and run the test suite:
npm install
npm testThis project also uses Husky and commitlint to validate commit messages before they are accepted.
