A collection of utilities that I got tired of re-implementing.
This package is written for use in ES Module environments. It should work out-of-the-box with projects using a bundler like Vite, Rollup, or ESBuild. Currently CommonJS is not supported, but will be in the future if a need arises.
All top-level utilities should be considered safe for all modern js-based runtimes. They should not include any runtime-specific logic or API's, and any runtime-specific modules can be found in respective /node or /browser directories.
For example, the logging utility module is runtime agnostic, whereas the node/logging utility module is altered to provide more features when running in node, and imports from node:console to do so.
// Something running in the browser or non-node environment
import { makeLogger } from '@bengsfort/stdlib/logging';
// Something running in node that wants node-specific features
import { makeLogger } from '@bengsfort/stdlib/node/logging';Once a PR hits main, the release workflow will trigger and any changesets will be handled automatically.
- When a new feature or change has been made, run
pnpm changes:addto create a changeset (this should be commited). - When ready to release, run
pnpm changes:committo apply all changes and update changelogs. - Run
pnpm installto update lockfile and rebuild packages. - Commit and run
pnpm ci:publishto publish.