Skip to content

Commit

Permalink
v0.1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
ndaidong committed Jun 17, 2016
1 parent dd16488 commit d6a3384
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 49 deletions.
65 changes: 19 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,68 +12,41 @@ This library is very lightweight to use at client side. Just about 160B gzip or

# Demo

[How does it work?](http://ndaidong.github.io/txtgen/).
[See how it works?](http://ndaidong.github.io/txtgen/)


# Setup
## Setup

##### Node.js
- Node.js

```
npm install txtgen --save
```

##### SystemJS

```
System.config({
baseUrl: '/path/to/js/folder',
map: {
txtgen: 'txtgen.min'
}
});
System.import('txtgen').then((txtgen) => {
// use txtgen here
});
```
```
npm install txtgen --save
```

##### RequireJS
- CDN

```
require.config({
baseUrl: '/path/to/js/folder',
paths: {
txtgen: 'txtgen.min'
}
});
requirejs('txtgen', (txtgen) => {
// use txtgen here
});
```
[txtgen.min.js](https://cdn.rawgit.com/ndaidong/txtgen/master/dist/txtgen.min.js)

```
<script type="text/javascript" src="https://cdn.rawgit.com/ndaidong/txtgen/master/dist/txtgen.min.js"></script>
```

##### CDN
- This library also supports ES6 Module, AMD and UMD style.

```
<script type="text/javascript" src="https://cdn.rawgit.com/ndaidong/txtgen/master/dist/txtgen.min.js"></script>
```

# Usage

```
var txtgen = require('txtgen');
var txtgen = require('txtgen');
let sentence = txtgen.sentence();
console.log(sentence);
let sentence = txtgen.sentence();
console.log(sentence);
let paragraph = txtgen.paragraph();
console.log(paragraph);
let paragraph = txtgen.paragraph();
console.log(paragraph);
let article = txtgen.article();
console.log(article);
let article = txtgen.article();
console.log(article);
```

# APIs
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"version": "0.1.21",
"version": "0.1.22",
"name": "txtgen",
"description": "Util for generating random sentences, paragraphs and articles in English",
"homepage": "http://ndaidong.github.io/txtgen",
"repository": {
"type": "git",
"url": "git@github.com:ndaidong/txtgen.git"
"url": "https://github.com/ndaidong/txtgen"
},
"author": "Dong Nguyen <[email protected]> (https://twitter.com/ndaidong)",
"author": "@ndaidong",
"main": "./index.js",
"engines": {
"node": ">= 6.0.0"
Expand Down

0 comments on commit d6a3384

Please sign in to comment.