win-attributes
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

win-attributes

integration

Lightweight dependency-free Node.js package to get and set filesystem attributes in Microsoft Windows.

Installation

npm install win-attributes
# or
yarn add win-attributes

Usage

import { getAttributes, FileAttribute, setAttributes, SetAttributes  } from 'win-attributes';

(async () => {
  // retrieve attributes
  const path = '/path/to/directory';
  const attributes = await getAttributes(path);
  if (attributes.hidden) {
    console.log(`${path} is hidden`);
  }

  // set attributes
  const settings: SetAttributes = {
    [FileAttribute.Hidden]: false,
    [FileAttribute.Readonly]: false,
  };
  await setAttributes(path, settings);
})();

Development

# install dependencies
npm install

# lint
npm run lint

# run example
npm run example

# run tests
npm run test

# build
npm run build

Package Sidebar

Install

npm i win-attributes

Weekly Downloads

3

Version

0.2.2

License

MIT

Unpacked Size

25.7 kB

Total Files

13

Last publish

Collaborators

  • sedlatschek