node package manager

fs-xattr

Node.js module for manipulating extended attributes.

fs-xattr

Node.js module for manipulating extended attributes.

There are already some libraries for this, why use fs-xattr?

  • Very useful errors
  • No limits on value size
  • Clean and easy api
  • Proper asynchronous implementation
npm install --save fs-xattr
var xattr = require('fs-xattr')

Get extended attribute attr from file at path.

cb is a callback that will be called with (err, val).

Synchronous version of xattr.get

Set extended attribute attr to value on file at path.

value can be either a string or a Buffer.

cb is a callback that will be called with (err).

Synchronous version of xattr.set

Remove extended attribute attr on file at path.

cb is a callback that will be called with (err).

Synchronous version of xattr.remove

List all attributes on file at path.

cb is a callback that will get called with (err, list). list in an array of strings, e.g. ['com.linusu.test', 'com.apple.FinderInfo'].

Synchronous version of xattr.list