Require Node.js 14 and move to ESM

This commit is contained in:
Sindre Sorhus 2022-06-03 12:14:47 +07:00
parent 65ea91297e
commit 9bc8f8b655
7 changed files with 337 additions and 295 deletions

View file

@ -24,7 +24,7 @@ npm install @sindresorhus/is
## Usage
```js
const is = require('@sindresorhus/is');
import is from '@sindresorhus/is';
is('🦄');
//=> 'string'
@ -39,7 +39,7 @@ is.number(6);
[Assertions](#type-assertions) perform the same type checks, but throw an error if the type does not match.
```js
const {assert} = require('@sindresorhus/is');
import {assert} from '@sindresorhus/is';
assert.string(2);
//=> Error: Expected value which is `string`, received value of type `number`.