Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/troygoode/node-beta
Beta flags for node.js & express.
https://github.com/troygoode/node-beta
Last synced: about 5 hours ago
JSON representation
Beta flags for node.js & express.
- Host: GitHub
- URL: https://github.com/troygoode/node-beta
- Owner: troygoode
- License: mit
- Created: 2012-09-19T13:44:34.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-11-14T14:12:49.000Z (about 11 years ago)
- Last Synced: 2024-10-13T22:21:20.136Z (about 1 month ago)
- Language: JavaScript
- Size: 141 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
node-beta
=========Beta flags for node.js & express.
[![NPM](https://nodei.co/npm/beta.png?downloads=true&stars=true)](https://nodei.co/npm/beta/)
[![build status](https://secure.travis-ci.org/troygoode/node-beta.png)](http://travis-ci.org/troygoode/node-beta)
### Installation (via [npm](https://npmjs.org/package/beta))
```bash
$ npm install beta
```### Usage
```javascript
var Beta = require('beta');
var beta = new Beta({
userIdentifier: function(req){ return req.session.username; }
});app.use(beta.middleware());
beta.check('MYFLAG', function(err, on){
});app.get('/', function(req, res){
req.beta('MYFLAG', function(err, on){
if(on)
// blah
});req.beta(['MYFLAG', 'MYFLAG2'], function(err, flags){
if(flags.MYFLAG || flags.MYFLAG2)
// blah
});
});
```