GitXplorerGitXplorer
l

nedb-logger

public
50 stars
4 forks
2 issues

Commits

List of commits on branch master.
Unverified
300c8836b7cee909521d3dd553d814b287de721f

Merge branch 'master' of github.com:louischatriot/nedb-logger

llouischatriot committed 11 years ago
Unverified
8b43a0d07c55d86c0edf2b875600e857f34e6f68

Test it works without a callback

llouischatriot committed 11 years ago
Unverified
60df18fbde14813649dc653032d14dcb6b761b42

Update README.md

llouischatriot committed 11 years ago
Unverified
95340fd43255ad09076049090c9d82314122628b

Update README.md

llouischatriot committed 11 years ago
Unverified
7e2f630845e249bd3ae7debaab17ca467757001b

Complete behavior tested

llouischatriot committed 11 years ago
Unverified
8fd8d6f28dadc86ec6cbc49db99f6b047d78e87f

Tested inserting an array of docs

llouischatriot committed 11 years ago

README

The README file for this repository.

NeDB Logger

NeDB Logger is a logger that writes object and JSON messages to a datafile readable by NeDB, with minimal RAM footprint since it doesn't keep a cache of the database in memory. Use it when your application doesn't need to use the database capabilities of NeDB, just the logging ones. You can then use NeDB to query and modify your database.

API

var Logger = require('nedb-logger')
  , logger = new Logger({ filename: "path/to/datafile" });

logger.insert({ hello: "world", number: 42, timestamp: new Date() }, function (err) {
  // err will not be null if the object is not well formatted for NeDB
  // meaning one of the keys contains a dot or begins with a dollar sign
});

// You can insert arrays of documents
// The callback is optional
logger.insert([{ planet: "earth" }, { planet: "Mars" }]);

License

(The MIT License)

Copyright (c) 2013 Louis Chatriot <louis.chatriot@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.