Skip to content

Commit dbfa1ff

Browse files
beeme1mrtoddbaert
andauthored
chore: Update readme to include usage (#114)
* Update readme to include usage Signed-off-by: Michael Beemer <[email protected]> * Update README.md Co-authored-by: Todd Baert <[email protected]> Signed-off-by: Michael Beemer <[email protected]> * remove iffe Signed-off-by: Michael Beemer <[email protected]> Co-authored-by: Todd Baert <[email protected]>
1 parent 66ed1b1 commit dbfa1ff

File tree

1 file changed

+34
-10
lines changed

1 file changed

+34
-10
lines changed

README.md

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
11
# OpenFeature SDK for NodeJS
22

3-
![Experimental](https://img.shields.io/badge/experimental-breaking%20changes%20allowed-yellow)
4-
![Alpha](https://img.shields.io/badge/alpha-release-red)
3+
[![a](https://img.shields.io/badge/slack-%40cncf%2Fopenfeature-brightgreen?style=flat&logo=slack)](https://cloud-native.slack.com/archives/C0344AANLA1)
54
[![codecov](https://codecov.io/gh/open-feature/node-sdk/branch/main/graph/badge.svg?token=3DC5XOEHMY)](https://codecov.io/gh/open-feature/node-sdk)
5+
[![npm version](https://badge.fury.io/js/@openfeature%2Fnodejs-sdk.svg)](https://badge.fury.io/js/@openfeature%2Fnodejs-sdk)
66
[![Known Vulnerabilities](https://snyk.io/test/github/open-feature/node-sdk/badge.svg)](https://snyk.io/test/github/open-feature/node-sdk)
77

8-
## Alpha Checklist
8+
## Installation
99

10-
- [x] spec compliant
11-
- [x] contains test suite which verifies behavior consistent with spec
12-
- [x] contains test suite with reasonable coverage
13-
- [x] automated publishing
14-
- [ ] comprehensive readme
10+
```shell
11+
npm install @openfeature/nodejs-sdk
12+
```
1513

16-
## Installation
14+
or
1715

16+
```shell
17+
yarn add @openfeature/nodejs-sdk
1818
```
19-
$ npm install @openfeature/nodejs-sdk // installs the latest version
19+
20+
## Usage
21+
22+
```typescript
23+
import { OpenFeature } from '@openfeature/nodejs-sdk';
24+
25+
OpenFeature.setProvider(new MyProvider());
26+
27+
const client = OpenFeature.getClient();
28+
29+
const value = await client.getBooleanValue('enabled-new-feature', false);
2030
```
2131

2232
## Development
@@ -36,3 +46,17 @@ Run tests with `npm test`.
3646
Both ES modules and CommonJS modules are supported, so consumers can use both `require` and `import` functions to utilize this module. This is accomplished by building 2 variations of the output, under `dist/esm` and `dist/cjs`, respectively. To force resolution of the `dist/esm/**.js*` files as modules, a package json with only the context `{"type": "module"}` is included at a in a `postbuild` step. Type declarations are included at `/dist/types/`
3747

3848
For testing purposes, you can add a comment containing "/publish" in any PR. This will publish an experimental SDK version with the git SHA appended to the version number.
49+
50+
## Contributors
51+
52+
Thanks so much to our contributors.
53+
54+
<a href="https://github.com/open-feature/node-sdk/graphs/contributors">
55+
<img src="https://contrib.rocks/image?repo=open-feature/node-sdk" />
56+
</a>
57+
58+
Made with [contrib.rocks](https://contrib.rocks).
59+
60+
## License
61+
62+
Apache License 2.0

0 commit comments

Comments
 (0)