chore(release): 1.0.0 [skip ci]

# 1.0.0 (2020-11-12)

### Bug Fixes

* export and docs ([8ad9031](https://github.com/node-casbin/etcd-watcher/commit/8ad903133425965289f2f5e75ddef51ae5b8c437))
* upgrade TypeScript for building ([9e61e9f](https://github.com/node-casbin/etcd-watcher/commit/9e61e9f3100fbba6dd31e69da2258395251a26c3))
2 files changed
tree: 8b830dd485b56e921c4da2f612777f74e0920f70
  1. .github/
  2. examples/
  3. src/
  4. test/
  5. .gitignore
  6. .prettierrc
  7. .releaserc.json
  8. CHANGELOG.md
  9. jest.config.js
  10. LICENSE
  11. package.json
  12. README.md
  13. tsconfig.json
  14. tslint.json
  15. yarn.lock
README.md

etcd-watcher

ETCD watcher for node-casbin

Installation

# NPM
npm install --save @casbin/etcd-watcher

# Yarn
yarn add @casbin/etcd-watcher

Simple Example

import EtcdWatcher from '@casbin/etcd-watcher';
import { newEnforcer } from 'casbin';

// Initialize the watcher.
const watcher = await EtcdWatcher.newWatcher('http://127.0.0.1:2379');

// Initialize the enforcer.
const enforcer = await newEnforcer('examples/authz_model.conf', 'examples/authz_policy.csv');

enforcer.setWatcher(watcher);