Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
se-panfilov committed Jun 5, 2019
1 parent b7b1db2 commit 9e66955
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,42 +49,6 @@ Getting Started
checkVAT('BE0411905847', [austria]); // false: accept only Austria VATs
```

About modules... ES6 / CommonJS / AMD / UMD
----------

jsvat build includes `es6`, `commonjs`, `amd` and `umd` builds at the same time.

By default you will stick to `es6` version for browsers and build tools (webpack, etc):
which expects you to import it as

```javascript
import {checkVAT, belgium, austria} from 'jsvat';
````

Node.js automatically will pick up `CommonJS` version by default.
Means you could import it like:

```javascript
const { checkVAT, belgium, austria } = require('jsvat');
```

You also can manually pick version you want, e.g.:

```jsx harmony
// CommonJS (i.g nodejs)
const { checkVAT, belgium, austria } = require('jsvat/lib/commonjs');
// ES6
import {checkVAT, belgium, austria} from 'jsvat/lib/es6';
// UMD
<script src="whatever/jsvat/lib/umd.index.js"></script>
// AMD
const { checkVAT, belgium, austria } = require('jsvat/lib/amd');
```

Return value
---------

Expand Down Expand Up @@ -180,6 +144,42 @@ checkVAT('WD12345678', [wonderland]); // true

```

About modules... ES6 / CommonJS / AMD / UMD
----------

jsvat build includes `es6`, `commonjs`, `amd` and `umd` builds at the same time.

By default you will stick to `es6` version for browsers and build tools (webpack, etc):
which expects you to import it as

```javascript
import {checkVAT, belgium, austria} from 'jsvat';
````

Node.js automatically will pick up `CommonJS` version by default.
Means you could import it like:

```javascript
const { checkVAT, belgium, austria } = require('jsvat');
```

You also can manually pick version you want, e.g.:

```jsx harmony
// CommonJS (i.g nodejs)
const { checkVAT, belgium, austria } = require('jsvat/lib/commonjs');
// ES6
import {checkVAT, belgium, austria} from 'jsvat/lib/es6';
// UMD
<script src="whatever/jsvat/lib/umd.index.js"></script>
// AMD
const { checkVAT, belgium, austria } = require('jsvat/lib/amd');
```

How jsvat checks validity?
---------

Expand Down

0 comments on commit 9e66955

Please sign in to comment.