fs-xattr
Node.js module for manipulating extended attributes.
Last updated 3 months ago by linusu .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install fs-xattr 
SYNC missed versions from official npm registry.

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

Installation

npm install --save fs-xattr

Usage

const xattr = require('fs-xattr')

await xattr.set('index.js', 'com.linusu.test', 'Hello, World!')

console.log(await xattr.get('index.js', 'com.linusu.test'))
//=> Hello, World!

API

get(path, attr)

  • path (string, required)
  • attr (string, required)
  • returns Promise<Buffer> - a Promise that will resolve with the value of the attribute.

Get extended attribute attr from file at path.

getSync(path, attr)

  • path (string, required)
  • attr (string, required)
  • returns Buffer

Synchronous version of get.

set(path, attr, value)

  • path (string, required)
  • attr (string, required)
  • value (Buffer or string, required)
  • returns Promise<void> - a Promise that will resolve when the value has been set.

Set extended attribute attr to value on file at path.

setSync(path, attr, value)

  • path (string, required)
  • attr (string, required)
  • value (Buffer or string, required)

Synchronous version of set.

remove(path, attr)

  • path (string, required)
  • attr (string, required)
  • returns Promise<void> - a Promise that will resolve when the value has been removed.

Remove extended attribute attr on file at path.

removeSync(path, attr)

  • path (string, required)
  • attr (string, required)

Synchronous version of remove.

list(path)

  • path (string, required)
  • returns Promise<Array<string>> - a Promise that will resolve with an array of strings, e.g. ['com.linusu.test', 'com.apple.FinderInfo'].

List all attributes on file at path.

listSync(path)

  • path (string, required)
  • returns Array<string>

Synchronous version of list.

Current Tags

  • 0.3.1                                ...           latest (3 months ago)

22 Versions

  • 0.3.1                                ...           3 months ago
  • 0.3.0                                ...           a year ago
  • 0.2.1                                ...           2 years ago
  • 0.2.0                                ...           3 years ago
  • 0.1.17                                ...           3 years ago
  • 0.1.16                                ...           3 years ago
  • 0.1.15                                ...           4 years ago
  • 0.1.14                                ...           4 years ago
  • 0.1.13                                ...           4 years ago
  • 0.1.12                                ...           4 years ago
  • 0.1.10                                ...           5 years ago
  • 0.1.11                                ...           5 years ago
  • 0.1.9                                ...           5 years ago
  • 0.1.8                                ...           5 years ago
  • 0.1.7                                ...           5 years ago
  • 0.1.6                                ...           5 years ago
  • 0.1.5                                ...           5 years ago
  • 0.1.4                                ...           6 years ago
  • 0.1.3                                ...           6 years ago
  • 0.1.2                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 6
This Week 6
This Month 119
Last Day 17
Last Week 165
Last Month 803
Dependencies (0)
None
Dev Dependencies (4)

Copyright 2014 - 2016 © taobao.org |