Comparing version
{ | ||
"name": "chronicle", | ||
"version": "0.1.0", | ||
"description": "Logging with support for MongoDB", | ||
"keywords": [], | ||
"dependencies": { | ||
"bash-color": "0.0.3", | ||
"mongojs": "~0.7.14" | ||
"version": "1.0.0", | ||
"description": "Tiny observable & high-performance state management", | ||
"license": "MIT", | ||
"author": "Robin van der Vleuten <robin@webstronauts.co>", | ||
"main": "dist/chronicle.js", | ||
"jsnext:main": "src/chronicle.js", | ||
"keywords": [ | ||
"flux", | ||
"reducer", | ||
"rx", | ||
"state" | ||
], | ||
"files": [ | ||
"src", | ||
"dist/*.js" | ||
], | ||
"scripts": { | ||
"build": "npm-run-all --silent transpile minify", | ||
"transpile": "rollup -c", | ||
"minify": "uglifyjs dist/chronicle.js -c collapse_vars,evaluate,unsafe,loops=false,keep_fargs=false,pure_getters,unused,dead_code -m -o dist/chronicle.min.js -p relative", | ||
"test": "jest --env=jsdom", | ||
"test:perf": "node ./test/perf", | ||
"format": "prettier --single-quote --trailing-comma es5 --write '{src,test,build}/**/*.js'", | ||
"precommit": "lint-staged --verbose", | ||
"prepublish": "yarn build" | ||
}, | ||
"devDependencies": { | ||
"express": "~3.3.5", | ||
"request": "~2.26.0" | ||
"lint-staged": { | ||
"*.js": [ | ||
"prettier --single-quote --trailing-comma es5 --write", | ||
"git add" | ||
] | ||
}, | ||
"scripts": { | ||
"test": "node test/index.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ForbesLindesay/chronicle.git" | ||
"url": "git+https://github.com/robinvdvleuten/chronicle.git" | ||
}, | ||
"author": "ForbesLindesay", | ||
"license": "MIT" | ||
} | ||
"bugs": { | ||
"url": "https://github.com/robinvdvleuten/chronicle/issues" | ||
}, | ||
"homepage": "https://github.com/robinvdvleuten/chronicle#readme", | ||
"devDependencies": { | ||
"babel-jest": "^20.0.1", | ||
"babel-preset-env": "^1.4.0", | ||
"benchmark": "^2.1.4", | ||
"husky": "^0.13.3", | ||
"jest": "^20.0.1", | ||
"lint-staged": "^3.4.1", | ||
"npm-run-all": "^4.0.2", | ||
"prettier": "^1.3.1", | ||
"redux": "^3.7.0", | ||
"redux-saga": "^0.15.3", | ||
"redux-thunk": "^2.2.0", | ||
"rollup": "^0.41.6", | ||
"rollup-plugin-babel": "^2.7.1", | ||
"uglify-js": "^3.0.3" | ||
} | ||
} |
# chronicle | ||
Logging with support for MongoDB | ||
Tiny observable & high-performance state management. | ||
[](https://travis-ci.org/ForbesLindesay/chronicle) | ||
[](https://gemnasium.com/ForbesLindesay/chronicle) | ||
[](http://badge.fury.io/js/chronicle) | ||
[](https://travis-ci.org/robinvdvleuten/chronicle) | ||
## Installation | ||
npm install chronicle | ||
``` | ||
$ npm i chronicle --save | ||
``` | ||
## Usage | ||
```js | ||
import chronicle, { thunk } from 'chronicle'; | ||
const ACTIONS = { | ||
INCREMENT: state => ({ counter: state.counter + 1 }), | ||
DECREMENT: state => ({ counter: state.counter - 1 }), | ||
}; | ||
const store = chronicle( | ||
(state = { counter: 0 }, action) => | ||
action && ACTIONS[action.type] | ||
? ACTIONS[action.type](state, action) | ||
: state | ||
); | ||
store(thunk()); | ||
const unsubscribe = store(({ dispatch }) => next => action => { | ||
console.log(action); | ||
return next(action); | ||
}); | ||
store.dispatch(dispatch => dispatch({ type: 'INCREMENT' })); | ||
unsubscribe(); | ||
store.dispatch({ type: 'INCREMENT' }); | ||
store.dispatch({ type: 'INCREMENT' }); | ||
console.log(store.getState()); | ||
``` | ||
## Performance | ||
You can run the performance test through `npm run test:perf`; | ||
```bash | ||
chronicle x 892,393 ops/sec ±4.99% (66 runs sampled) | ||
chronicle with thunk x 332,470 ops/sec ±3.61% (49 runs sampled) | ||
redux x 557,308 ops/sec ±1.63% (89 runs sampled) | ||
redux with thunk x 288,050 ops/sec ±1.25% (90 runs sampled) | ||
Fastest is chronicle | ||
``` | ||
## Credits | ||
Thanks Forbes Lindesay for donating the `chronicle` npm name. | ||
## License | ||
MIT | ||
MIT © [Robin van der Vleuten](https://www.robinvdvleuten.nl) |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
0
-100%1
-50%0
-100%66
340%7416
-45.8%14
600%6
-25%67
-81.02%2
Infinity%- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed