How to use the fs-xattr.remove function in fs-xattr

To help you get started, we’ve selected a few fs-xattr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github viddo / atom-textual-velocity / lib / service-consumers / NVTags.js View on Github external
write(path, str, callback) {
        var tags = str
          .trim()
          .split(" ")
          .reduce((memo, val) => {
            if (memo.indexOf(val) === -1) {
              memo.push(val);
            }
            return memo;
          }, []);

        if (tags.length && tags[0] !== "") {
          var plistBuf = bplist.create([tags]);
          xattr.set(path, XATTR_KEY, plistBuf, callback);
        } else {
          xattr.remove(path, XATTR_KEY, callback);
        }

        var now = new Date();
        fs.utimesSync(path, now, now); // update last access/update times
      }
    });

fs-xattr

Node.js module for manipulating extended attributes.

MIT
Latest version published 3 years ago

Package Health Score

50 / 100
Full package analysis

Similar packages