Skip to content
This repository has been archived by the owner on Nov 16, 2019. It is now read-only.

npm/nicely-placed-modification-logs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nicely-placed-modification-logs

write modifications/events to append only logs. process those changes sequentially. like an _changes feed but in a file

##work in progress

var dir = __dirname+"/data"
var modlogs = require('nicely-placed-modification-logs')
var logs = modlogs({dir:__dirname+"/data"})

logs.on("error",function(err){
  console.log(err!)
})

logs.write({data:"important stufff"},function(err){
  // saved!
})

var s = modlogs.read({dir:,since:0})

s.on('data',function(event){
  console.log(event.seq)
  // [log name]-[bytewise encoded byte offset]
  // 000000000-420000000000000000
  console.log(event.data)
  // "hi!\n"  
})

About

write modifications/events to append only logs. process those changes sequentially. like an _changes feed but in a file

Resources

License

Stars

Watchers

Forks

Packages

No packages published