Utility is an npm package that bundles common JavaScript helpers for hashing, encoding, dates, numbers, strings, JSON, and related tasks. It can be used from JavaScript or TypeScript.
Overview
Utility packages a set of small, reusable functions for everyday Node.js development. It collects useful utilities rather than operating as a standalone application.
Documented areas include cryptographic helpers such as md5, sha1, sha256, and hmac, plus decode and encode routines and other general helpers. Separate sections cover date utilities, number utilities, timeout helpers including runWithTimeout, map creation without ordinary Object prototypes, and string helpers.
JSON-related helpers include synchronous and async APIs; writeJSON accepts optional replacer and spacing options aligned with JSON.stringify behavior. The package is published on npm and distributed under the MIT license.
Individual helpers are documented alongside the package; overall it supplies shared low-level routines for other Node projects.
Key features
- MD5, SHA1, SHA256, and HMAC helpers
- Encode and decode utilities
- Date and number helpers
- Promise timeout via runWithTimeout
- Null-prototype map helper
- String and arguments helpers
- JSON read and write helpers
- TypeScript-friendly usage
Use cases
- Shared helpers in Node.js applications
- Checksum and HMAC in server code
- JSON file utilities in tooling
- Timeout-wrapped async operations
- TypeScript projects importing npm utilities