New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

chronicle

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chronicle - npm Package Compare versions

Comparing version

to
1.0.0

dist/chronicle.js

68

package.json
{
"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.
[![Build Status](https://travis-ci.org/ForbesLindesay/chronicle.png?branch=master)](https://travis-ci.org/ForbesLindesay/chronicle)
[![Dependency Status](https://gemnasium.com/ForbesLindesay/chronicle.png)](https://gemnasium.com/ForbesLindesay/chronicle)
[![NPM version](https://badge.fury.io/js/chronicle.png)](http://badge.fury.io/js/chronicle)
[![Build Status](https://travis-ci.org/robinvdvleuten/chronicle.svg?branch=master)](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