Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Commit

Permalink
update repository
Browse files Browse the repository at this point in the history
  • Loading branch information
vdemedes committed Oct 24, 2015
1 parent 22ed882 commit 89ab9b3
Show file tree
Hide file tree
Showing 10 changed files with 398 additions and 393 deletions.
6 changes: 4 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
root = true

[*]
indent_style = space
indent_style = tab
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{package.json,*.yml}]
indent_style = space

[Makefile]
indent_style = tab
indent_size = 4

[*.md]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
.nyc_output
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: node_js
node_js:
- 'stable'
- '0.12'
- '0.10'
after_success: npm run coveralls
2 changes: 1 addition & 1 deletion License.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) vdemedes <vdemedes@gmail.com> (https://github.com/vdemedes)
Copyright (c) Vadym Demedes <vdemedes@gmail.com> (https://github.com/vdemedes)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 0 additions & 11 deletions Makefile

This file was deleted.

32 changes: 16 additions & 16 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# crown [![Circle CI](https://circleci.com/gh/vdemedes/crown.svg?style=svg)](https://circleci.com/gh/vdemedes/crown)
# Crown

[![Build Status](https://travis-ci.org/vdemedes/crown.svg?branch=master)](https://travis-ci.org/vdemedes/crown) [![Coverage Status](https://coveralls.io/repos/vdemedes/crown/badge.svg?branch=master&service=github)](https://coveralls.io/github/vdemedes/crown?branch=master)

Give access to your new features gradually.
Make them available to a percentage of your users, certain group or specific users.
Expand All @@ -16,22 +18,22 @@ Inspired by Ruby's [rollout](https://github.com/FetLife/rollout) gem.
</h1>


### Features
## Features

- Configurable backend
- Roll out features to percentage of users, groups or specific users
- Enable/disable features
- Promise-based API


### Installation
## Installation

```
$ npm install crown --save
```


### Usage
## Usage

```js
const Crown = require('crown');
Expand All @@ -51,7 +53,7 @@ yield rollout.enablePercentage('chat', 20);
var hasChat = yield rollout.isEnabled('chat', { id: 1 }); // true
```

#### Check if user has access to a feature
### Check if user has access to a feature

To validate access of a certain user to a feature, use `isEnabled()` method.
It accepts 2 arguments: `name` of the feature and `user` object.
Expand All @@ -71,7 +73,7 @@ rollout.idAttribute = '_id';
```


#### Enable feature for everyone
### Enable feature for everyone

`enable()` method gives access to all users, regardless of any other rules.

Expand All @@ -86,7 +88,7 @@ yield rollout.disable('chat');
```


#### Enable feature for a percentage of users
### Enable feature for a percentage of users

You can enable certain feature for only a percentage of all users:

Expand All @@ -101,7 +103,7 @@ CRC32(user_id + feature_name) % 100 < percentage
```


#### Enable feature for a group of users
### Enable feature for a group of users

You can register a group of users, that satisfy some custom criteria:

Expand Down Expand Up @@ -130,7 +132,7 @@ yield rollout.disableGroup('chat', 'beta-testers');
```


#### Enable feature for a specific user
### Enable feature for a specific user

You can also restrict access to specific users:

Expand All @@ -151,7 +153,7 @@ yield rollout.disableUser('chat', goodUser);
```


### Backend stores
## Backend stores

Crown can use whatever backend you want, as soon as there is an adapter for it.
Take a look how easy it is to write one, check out built-in [MemoryStore](https://github.com/vdemedes/crown-memory-store/blob/master/index.js).
Expand All @@ -173,15 +175,13 @@ let rollout = new Crown({
```


### Tests

[![Circle CI](https://circleci.com/gh/vdemedes/crown.svg?style=svg)](https://circleci.com/gh/vdemedes/crown)
## Tests

```
$ make test
$ npm test
```


### License
## License

MIT © [vdemedes](https://github.com/vdemedes)
MIT © [Vadym Demedes](https://github.com/vdemedes)
3 changes: 0 additions & 3 deletions circle.yml

This file was deleted.

Loading

0 comments on commit 89ab9b3

Please sign in to comment.