Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
iguntur committed Mar 21, 2018
1 parent d4f5e3e commit 10eeb24
Showing 1 changed file with 40 additions and 4 deletions.
44 changes: 40 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,24 @@
- [Install](#install)
- [Usage](#usage)
- [API](#api)
- [Examples](#examples)
- [Browser](#browser)
- [Source](#source)

---


## Install

Using [__`npm`__](https://npmjs.com)
Install via [__`npm`__](https://npmjs.com) package manager

```
```console
$ npm install administratif-indonesia
```

or if you prefer using [__`yarn`__](https://yarnpkg.com) package manager

```
```console
$ yarn add administratif-indonesia
```

Expand Down Expand Up @@ -84,9 +86,43 @@ Returns a `boolean` value if key has exists.
- Default: `undefined`


### Examples

> __NOTE:__ Jika ukuran (size) data sangat besar, gunakanlah [`ReadableStreams`](https://nodejs.org/api/fs.html#fs_fs_createreadstream_path_options).
#### Basic

```js
const ai = new AdministratifIndonesia();

// synchronous output
console.log(fs.readFileSync(ai.get('31-dki-jakarta'), 'utf8'));

// Readable Streams
fs.createReadStream(ai.get('31-dki-jakarta')).pipe(process.stdout);
```

#### Server

```js
const ai = new AdministratifIndonesia();

app.get('/api/administratif-indonesia/:identifier', (request, response) => {
fs.createReadStream(ai.get(request.params.identifier))
.pipe(response);
});
```


## Browser

Semua file [Administratif Indonesia](https://unpkg.com/administratif-indonesia/storages/) dapat di akses langsung via browser melalui [unpkg.com](https://unpkg.com).

👉 [https://unpkg.com/administratif-indonesia/storages/](https://unpkg.com/administratif-indonesia/storages/)

## Source

Mempertimbangkan beberapa sumber yang ada, librari ini menggunakan data yang bersumber dari [**Ditjen PUM Kemendagri**](http://www.kemendagri.go.id/pages/data-wilayah) (Permendagri No. 56-2015).
Mempertimbangkan beberapa sumber yang ada, librari ini menggunakan data yang bersumber dari [**Ditjen PUM Kemendagri**](http://www.kemendagri.go.id/pages/data-wilayah) (__Permendagri No. 137-2017__).


## Conclusions
Expand Down

0 comments on commit 10eeb24

Please sign in to comment.