This is a module to operate tags on OSX Mavericks. You can get/set/add/remove tags with simple API methods. Works only on Mac OSX 10.9.x.
Install osx-tag
with npm:
$ 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;
});
});
- All methods works asynchronously.
- All arguments are required and cannot be omitted.
path
- Path of the file/directory to retrieve tags.callback
- This callback function gets two arguments(err, tags)
wheretags
is an array of tag names.
path
- Path of the file/directory to set tags.tags
- Array of tag names to set. File/directory's tags are overwritten with these.callback
- This callback gets one argument(err)
.
path
- Path of the file/directory to add tags.tags
- Array of tag names to add.callback
- This callback gets one argument(err)
.
path
- Path of the file/directory to remove tags.tags
- Array of tag names to remove.callback
- This callback gets one argument(err)
.