From c33f2150ea21766307abe5e62029b0d3d8e20098 Mon Sep 17 00:00:00 2001 From: Zach Butler Date: Fri, 2 Aug 2024 15:41:20 -0400 Subject: [PATCH] README: Start "Usage" section --- README.md | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index e15d8a8..208bf8b 100644 --- a/README.md +++ b/README.md @@ -4,18 +4,7 @@ Extremely lightweight, zero dependency variable checks missing in nodeJS but com is.nullOrEmpty(input: any): boolean is.string(input: any): boolean; ``` -Install it from [NPM](https://www.npmjs.com/package/@kj4ezj/is) with your preferred package manager... -```bash -bun add @kj4ezj/is -cnpm install @kj4ezj/is -npm install @kj4ezj/is -pnpm add @kj4ezj/is -yarn add @kj4ezj/is -``` -...then import it into your source code. -```js -const is = require('@kj4ezj/is'); -``` +Install `@kj4ezj/is` from [NPM](https://www.npmjs.com/package/@kj4ezj/is) with your preferred package manager! @@ -30,6 +19,7 @@ const is = require('@kj4ezj/is'); 1. [Background](#background) +1. [Usage](#usage) 1. [Development](#development) 1. [Prerequisites](#prerequisites) 1. [Initialization](#initialization) @@ -52,6 +42,26 @@ In the old days™, nodeJS lacked most utilities developers take for granted in The `is.js` library provides the most fundamental utilities remaining absent in modern `node` that I expect to have in any language, and nothing more. At the time of writing, `is.js` weighs in at just _461 bytes_, five orders of magnitude smaller than `lodash`! +## Usage +Install `@kj4ezj/is` from [NPM](https://www.npmjs.com/package/@kj4ezj/is) with your preferred package manager... +```bash +bun add @kj4ezj/is +cnpm install @kj4ezj/is +npm install @kj4ezj/is +pnpm add @kj4ezj/is +yarn add @kj4ezj/is +``` +...then import it into your source code. +```js +const is = require('@kj4ezj/is'); +``` +Two utilities are provided. +```ts +is.nullOrEmpty(input: any): boolean +is.string(input: any): boolean; +``` +These are documented in the sections below, but the [test cases](./is.test.js) written against expectations should be considered authoritative. + ## Development Start here to contribute to this repo.