Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
Modified ReadMe.md
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengxiaoyao0716 committed Nov 23, 2017
1 parent 5eef78b commit f368893
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@
***
## Install:
### Node
> [babel-runtime][transform-runtime] is required, or you can consider this way: [simple](#Simple) .
> Sine v2.0.0, [babel-runtime][transform-runtime] is required, or you can consider use old version (`js-pattern-match@1.5.0`) or this way: [simple](#Simple) .
``` javascript
// npm i js-pattern-match --save-dev
import match from 'js-pattern-match';
```

### Browser
> Since some runtimes joined in, the size of `match.min.js` is larger than actual. So if you are working with `babel`, consider this way: [Node](#Node) .
> Since v2.0.0, some runtimes joined in, the size of `match.min.js` is larger than actual ( [44.1 KB](https://github.com/zhengxiaoyao0716/js-pattern-match/releases/tag/2.0) vs [3.74 KB](https://github.com/zhengxiaoyao0716/js-pattern-match/releases/tag/1.5) ). So if you are working with `babel`, consider this way: [Node](#Node) .
``` html
<script src="https://zhengxiaoyao0716.github.io/js-pattern-match/dist/match.min.js"></script>
```
> Ofcause, You can download it and use it locally: [release page](https://github.com/zhengxiaoyao0716/js-pattern-match/releases) .
### Simple
> If you are using ES6 and working with mordern browser, you can just simple to add those code and it will works well:
Expand Down Expand Up @@ -70,7 +71,7 @@ let getLength = match([
]);
```

It looks alike, and if we have some macro or syntactic sugar we can easier to implements it. See [match_test.es6](./match_test.es6) for more details usage.
It looks alike, and if we have some macro or syntactic sugar we can easier to implements it. See [match_test.js](./src/match_test.js) for more details usage.

***
[transform-runtime]: https://babeljs.io/docs/plugins/transform-runtime/
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "js-pattern-match",
"version": "2.0.0",
"version": "2.0.1",
"description": "Implement pattern match in JS.",
"scripts": {
"build": "babel src/match.js -o lib/match.js --source-maps && webpack",
Expand Down

0 comments on commit f368893

Please sign in to comment.