Add color tags to files and folders on Mac OS X
  • JavaScript 100%
Find a file
Dave Jeffery 14c182e155
Merge pull request #3 from SmileMachine/depend-vulner-fix
Fix dependency vulnerabilities, and test errors.
2025-03-16 22:10:44 +00:00
.editorconfig first commit 2016-01-17 03:36:22 +00:00
.gitattributes first commit 2016-01-17 03:36:22 +00:00
.gitignore Update deps 2018-04-09 18:16:08 +01:00
.travis.yml Only test on mac 2018-04-09 17:51:18 +01:00
cli.js Update deps 2018-04-09 18:16:08 +01:00
index.js escape spaces in path 2018-04-09 16:41:55 +01:00
license first commit 2016-01-17 03:36:22 +00:00
package.json meow 13 does not support require 2025-03-16 13:21:38 +08:00
readme.md only osx systems are currently supported 2016-01-17 12:57:50 +00:00
test.js Fix dependency vulnerabilities 2025-03-16 12:40:24 +08:00

finder-tag Build Status

Add color tags to files and folders on Mac OS X

Note: this module currently only supports color tags on OS X. Support for adding/setting/getting all tags may come in the future. Pull Requests for this are welcome.

CLI

$ npm install --global finder-tag
$ finder-tag --help

  Easily add color tags to files and folders on Mac OS X

  Usage
    $ finder-tag [path] [color]

  Available Colors:
    `gray`, `green`, `purple`, `blue`, `yellow`, `red`, `orange`
    To clear all tags pass `clear` as the color

  Examples
    $ finder-tag ~/Desktop blue
    /Users/dave/Downloads is tagged `blue`
    $ finder-tag app.js yellow
    /root/site/scripts/app.js is tagged `yellow`
    $ finder-tag app.js clear
    /root/site/scripts/app.js all tags have been cleared

Using Programmatically

Install

$ npm install --save finder-tag

Usage

const finderTag = require('finder-tag');

finderTag('/some/path', 'blue').then(
  (result) => console.log(result)
  // { code: 0,
  //   command: 'xattr ...',
  //   path: '/some/path',
  //   tag: 'blue' }
);

API

finderTag(path, color)

path

Type: string

The filesystem path to apply the tag to.

color

Type: string

Available Colors:

  • 'gray'
  • 'green'
  • 'purple'
  • 'blue'
  • 'yellow'
  • 'red'
  • 'orange'
  • 'clear' - This will remove all tags

License

MIT © DaveJ