0.3.0 • Published 3 years ago

@ahouse/node-utilities v0.3.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

@ahouse/node-utilities

A few utility functions for JavaScript/TypeScript objects and arrays, with no external dependencies.

Installation

npm install @ahouse/node-utilites

Functions

readFileAsJSON5

Check if two arrays have the same values.

import { readFileAsJSON5 } from '@ahouse/node-utilities';
import path from 'path';

// Parse 'file.json5' from within the source directory:
const parsedObject = readFileAsJSON5(path.join(__dirname, 'file.json5'));

Development

To start, clone the repo and run the test suite to make sure everything is working.

git clone git@github.com:ahouse101/node-utilities.git
cd node-utilities
npm test

The dev branch is the main development branch, and it's also the default branch for a newly cloned repository. Feature branches should be nested under feature/, e.g. feature/some_new_function. The release branch points to the latest release. It should always be associated with a version tag, and it should always be able to pass the full test suite.

To publish a new version, first merge any needed changes into the release branch and then create a version tag. Then, assuming the test suite is clean, you can publish:

git checkout release
git merge dev
git tag -a v[X.Y.Z] -m "Title/description for the new version"
npm test  # Do not publish with test failures.
npm publish