A node.js package to manipulate tags associated with files on macOS.
$ npm install osx-tag
Simple example:
var tag = require('osx-tag');
var path = 'foo.txt';
tag.getTags(path, function(err, tags) {
if (err) throw err;
console.log(tags);
tag.addTags(path, ['Important', 'Photo'], function(err) {
if (err) throw err;
});
});
See test/test.js
for usage.
path
- Path of the file/directory to retrieve associated tags.callback
- This callback function is called with two arguments(err, tags)
wheretags
is an array of tags.
path
- Path of the file/directory to set tags.tags
- Array of tags to assign.callback
- This callback is called with one argument(err)
.
path
- Path of the file/directory to add tags.tags
- Array of tags to add.callback
- This callback is called with one argument(err)
.
path
- Path of the file/directory to remove tags.tags
- Array of tags to remove.callback
- This callback is called with one argument(err)
.