Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 448 Bytes

README.md

File metadata and controls

25 lines (18 loc) · 448 Bytes

Per file attributes

Just a simple per-file attributes system

var kv = require('file-attributes');

var attributes = kv("/path/to/disk"); // where to store

attributes.set("/home/user/documents/file.txt", JSON.stringify({
  ready: true,
  signed: false
}), function(err, data) {
  // on success/failure
});

attributes.get("/home/user/documents/file.txt", (err, data) => {
  if (err) {
    // fail
  }

  data = JSON.parse(data);
});