Js module to manipulate NTFS Alternate Data Stream (ADS) on windows.
Alternate data streams allow more than one data stream to be associated with a filename (a fork),
using the format filename:streamname
(e.g., text.txt:extrastream
).
You can store extended attributes by ADS in NTFS on windows as an alternative form of fs-xattr
npm install --save fs-ads
const ads = require('fs-ads')
Get Alternate Data Stream streamName
from file at path
.
options
is an object that used to set the encoding
of ads. The default encoding
is utf-8
. You can set some custom encoding.
options = { encoding: 'utf-8' } // default
options = { encoding: 'ascii' } // use ascii
options = { encoding: null } // the raw buffer is returned
cb
is a callback that will be called with (err, val)
.
Synchronous version of ads.get
Set Alternate Data Stream streamName
to value
on file at path
.
value
can be either a string or a Buffer
.
options
is an object that used to set the encoding
of ads. The encoding option is ignored if data is a Buffer
. It defaults to utf-8
.
options = { encoding: 'utf-8' } // default
options = { encoding: 'hex' } // use hex
cb
is a callback that will be called with (err)
.
Synchronous version of ads.set
Remove Alternate Data Stream streamName
on file at path
.
cb
is a callback that will be called with (err)
.
Synchronous version of ads.remove