Skip to content

Commit

Permalink
README: Start "Usage" section
Browse files Browse the repository at this point in the history
  • Loading branch information
kj4ezj committed Aug 2, 2024
1 parent 5900bb1 commit c33f215
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!

<!-- contents box begin -->
<table>
Expand All @@ -30,6 +19,7 @@ const is = require('@kj4ezj/is');
<!-- contents markdown begin -->

1. [Background](#background)
1. [Usage](#usage)
1. [Development](#development)
1. [Prerequisites](#prerequisites)
1. [Initialization](#initialization)
Expand All @@ -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.

Expand Down

0 comments on commit c33f215

Please sign in to comment.