Skip to content

Commit 1de2de3

Browse files
committed
Initial release
0 parents  commit 1de2de3

20 files changed

+2153
-0
lines changed

.bowerrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "bower_components"
3+
}

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
node_modules/
2+
bower_components/
3+
4+
.idea/
5+
6+
*.iml
7+
8+
coverage/
9+
10+
npm-debug.log
11+
12+
*.db

.jshintrc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"node": true,
3+
"browser": false,
4+
"esnext": true,
5+
"asi": true,
6+
"bitwise": true,
7+
"camelcase": true,
8+
"curly": true,
9+
"eqeqeq": true,
10+
"immed": true,
11+
"indent": 2,
12+
"latedef": true,
13+
"newcap": true,
14+
"undef": true,
15+
"unused": true,
16+
"noarg": true,
17+
"quotmark": "single",
18+
"regexp": true,
19+
"strict": false,
20+
"trailing": true,
21+
"smarttabs": true,
22+
"globals": {
23+
"describe": true,
24+
"it": true,
25+
"beforeEach": true,
26+
"afterEach": true,
27+
"assert": true,
28+
"fail": true,
29+
"console": true,
30+
"require": true,
31+
"module": true,
32+
"exports": true
33+
}
34+
}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
##### 0.1.0 - 28 September 2015
2+
3+
- Initial release

CONTRIBUTING.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Contributing Guide
2+
3+
First, support is handled via the [Gitter Channel](https://gitter.im/js-data/js-data) and the [Mailing List](https://groups.io/org/groupsio/jsdata). Ask your questions there.
4+
5+
When submitting issues on GitHub, please include as much detail as possible to make debugging quick and easy.
6+
7+
- good - Your versions of js-data, js-data-nedb, etc., relevant console logs/error, code examples that revealed the issue
8+
- better - A [plnkr](http://plnkr.co/), [fiddle](http://jsfiddle.net/), or [bin](http://jsbin.com/?html,output) that demonstrates the issue
9+
- best - A Pull Request that fixes the issue, including test coverage for the issue and the fix
10+
11+
[Github Issues](https://github.com/js-data/js-data-nedb/issues).
12+
13+
#### Submitting Pull Requests
14+
15+
1. Contribute to the issue/discussion that is the reason you'll be developing in the first place
16+
1. Fork js-data-nedb
17+
1. `git clone [email protected]:<you>/js-data-nedb.git`
18+
1. `cd js-data-nedb; npm install; bower install;`
19+
1. Write your code, including relevant documentation and tests
20+
1. Run `grunt test` (build and test)
21+
1. Your code will be linted and checked for formatting, the tests will be run
22+
1. The `dist/` folder & files will be generated, do NOT commit `dist/*`! They will be committed when a release is cut.
23+
1. Submit your PR and we'll review!
24+
1. Thanks!

Gruntfile.js

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
/*
2+
* js-data-nedb
3+
* https://github.com/js-data/js-data-nedb
4+
*
5+
* Copyright (c) 2014-2015 Jason Dobry <http://www.js-data.io/docs/dsnedbadapter>
6+
* Licensed under the MIT license. <https://github.com/js-data/js-data-nedb/blob/master/LICENSE>
7+
*/
8+
module.exports = function (grunt) {
9+
require('jit-grunt')(grunt, {
10+
coveralls: 'grunt-karma-coveralls'
11+
});
12+
require('time-grunt')(grunt);
13+
14+
var pkg = grunt.file.readJSON('package.json');
15+
16+
// Project configuration.
17+
grunt.initConfig({
18+
pkg: pkg,
19+
watch: {
20+
dist: {
21+
files: ['src/**/*.js'],
22+
tasks: ['build']
23+
}
24+
},
25+
coveralls: {
26+
options: {
27+
coverage_dir: 'coverage'
28+
}
29+
},
30+
mochaTest: {
31+
all: {
32+
options: {
33+
reporter: 'spec'
34+
},
35+
src: ['mocha.start.js', 'test/**/*.js']
36+
}
37+
},
38+
webpack: {
39+
dist: {
40+
debug: true,
41+
entry: './src/index.js',
42+
output: {
43+
filename: './dist/js-data-nedb.js',
44+
libraryTarget: 'commonjs2',
45+
library: 'js-data-nedb'
46+
},
47+
externals: [
48+
'mout/string/underscore',
49+
'mout/random/guid',
50+
'mout/array/map',
51+
'mout/array/unique',
52+
'js-data',
53+
'nedb'
54+
],
55+
module: {
56+
loaders: [
57+
{ test: /(src)(.+)\.js$/, exclude: /node_modules/, loader: 'babel-loader?blacklist=useStrict' }
58+
],
59+
preLoaders: [
60+
{
61+
test: /(src)(.+)\.js$|(test)(.+)\.js$/, // include .js files
62+
exclude: /node_modules/, // exclude any and all files in the node_modules folder
63+
loader: "jshint-loader?failOnHint=true"
64+
}
65+
]
66+
}
67+
}
68+
}
69+
});
70+
71+
grunt.registerTask('standard', function () {
72+
var child_process = require('child_process');
73+
var done = this.async();
74+
grunt.log.writeln('Linting for correcting formatting...');
75+
child_process.exec('node node_modules/standard/bin/cmd.js --parser babel-eslint src/index.js', function (err, stdout) {
76+
console.log(stdout);
77+
if (err) {
78+
grunt.log.writeln('Failed due to ' + (stdout.split('\n').length - 2) + ' lint errors!');
79+
done(err);
80+
} else {
81+
grunt.log.writeln('Done linting.');
82+
done();
83+
}
84+
});
85+
});
86+
87+
grunt.registerTask('n', ['mochaTest']);
88+
89+
grunt.registerTask('test', ['build', 'n']);
90+
grunt.registerTask('build', [
91+
'standard',
92+
'webpack'
93+
]);
94+
grunt.registerTask('go', ['build', 'watch:dist']);
95+
grunt.registerTask('default', ['build']);
96+
};

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014-2015 Jason Dobry
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<img src="https://raw.githubusercontent.com/js-data/js-data/master/js-data.png" alt="js-data logo" title="js-data" align="right" width="64" height="64" />
2+
3+
## js-data-nedb [![bower version](https://img.shields.io/bower/v/js-data-nedb.svg?style=flat-square)](https://www.npmjs.org/package/js-data-nedb) [![npm version](https://img.shields.io/npm/v/js-data-nedb.svg?style=flat-square)](https://www.npmjs.org/package/js-data-nedb) [![Circle CI](https://img.shields.io/circleci/project/js-data/js-data-nedb/master.svg?style=flat-square)](https://circleci.com/gh/js-data/js-data-nedb/tree/master) [![npm downloads](https://img.shields.io/npm/dm/js-data-nedb.svg?style=flat-square)](https://www.npmjs.org/package/js-data-nedb) [![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/js-data/js-data-nedb/blob/master/LICENSE)
4+
5+
nedb adapter for [js-data](http://www.js-data.io/).
6+
7+
### API Documentation
8+
[DSNedbAdapter](http://www.js-data.io/docs/dsnedbadapter)
9+
10+
### Project Status
11+
12+
__Latest Release:__ [![Latest Release](https://img.shields.io/github/release/js-data/js-data-nedb.svg?style=flat-square)](https://github.com/js-data/js-data-nedb/releases)
13+
14+
### Quick Start
15+
`bower install --save js-data js-data-nedb` or `npm install --save js-data js-data-nedb`.
16+
17+
Load `js-data-nedb.js` after `js-data.js`.
18+
19+
```js
20+
var adapter = new DSLocalStorageAdapter();
21+
22+
var store = new JSData.DS();
23+
store.registerAdapter('nedb', adapter, { default: true });
24+
25+
// "store" will now use the nedb adapter for all async operations
26+
```
27+
28+
### Changelog
29+
[CHANGELOG.md](https://github.com/js-data/js-data-nedb/blob/master/CHANGELOG.md)
30+
31+
### Community
32+
- [Gitter Channel](https://gitter.im/js-data/js-data) - Better than IRC!
33+
- [Announcements](http://www.js-data.io/blog)
34+
- [Mailing List](https://groups.io/org/groupsio/jsdata) - Ask your questions!
35+
- [Issues](https://github.com/js-data/js-data-nedb/issues) - Found a bug? Feature request? Submit an issue!
36+
- [GitHub](https://github.com/js-data/js-data-nedb) - View the source code for js-data.
37+
- [Contributing Guide](https://github.com/js-data/js-data-nedb/blob/master/CONTRIBUTING.md)
38+
39+
### Contributing
40+
41+
First, support is handled via the [Gitter Channel](https://gitter.im/js-data/js-data) and the [Mailing List](https://groups.io/org/groupsio/jsdata). Ask your questions there.
42+
43+
When submitting issues on GitHub, please include as much detail as possible to make debugging quick and easy.
44+
45+
- good - Your versions of js-data, js-data-nedb, etc., relevant console logs/error, code examples that revealed the issue
46+
- better - A [plnkr](http://plnkr.co/), [fiddle](http://jsfiddle.net/), or [bin](http://jsbin.com/?html,output) that demonstrates the issue
47+
- best - A Pull Request that fixes the issue, including test coverage for the issue and the fix
48+
49+
[Github Issues](https://github.com/js-data/js-data-nedb/issues).
50+
51+
#### Submitting Pull Requests
52+
53+
1. Contribute to the issue/discussion that is the reason you'll be developing in the first place
54+
1. Fork js-data-nedb
55+
1. `git clone [email protected]:<you>/js-data-nedb.git`
56+
1. `cd js-data-nedb; npm install; bower install;`
57+
1. Write your code, including relevant documentation and tests
58+
1. Run `grunt test` (build and test)
59+
1. Your code will be linted and checked for formatting, the tests will be run
60+
1. The `dist/` folder & files will be generated, do NOT commit `dist/*`! They will be committed when a release is cut.
61+
1. Submit your PR and we'll review!
62+
1. Thanks!
63+
64+
### License
65+
66+
The MIT License (MIT)
67+
68+
Copyright (c) 2014-2015 Jason Dobry
69+
70+
Permission is hereby granted, free of charge, to any person obtaining a copy
71+
of this software and associated documentation files (the "Software"), to deal
72+
in the Software without restriction, including without limitation the rights
73+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
74+
copies of the Software, and to permit persons to whom the Software is
75+
furnished to do so, subject to the following conditions:
76+
77+
The above copyright notice and this permission notice shall be included in all
78+
copies or substantial portions of the Software.
79+
80+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
81+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
82+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
83+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
84+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
85+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
86+
SOFTWARE.

circle.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
test:
2+
post:
3+
- grunt coveralls || true

0 commit comments

Comments
 (0)