{"_id":"@akryum/winattr","_rev":"7541","name":"@akryum/winattr","description":"Foolproof Windows® file attributes.","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"akryum","email":"alphadelta.fg@gmail.com"}],"time":{"modified":"2021-06-03T09:57:12.000Z","created":"2018-06-18T21:55:11.022Z","3.0.0":"2018-06-18T21:55:11.022Z"},"users":{},"author":{"name":"Steven Vachon","email":"contact@svachon.com","url":"https://www.svachon.com/"},"repository":{"type":"git","url":"git+https://github.com/Akryum/winattr.git"},"versions":{"3.0.0":{"name":"@akryum/winattr","description":"Foolproof Windows® file attributes.","version":"3.0.0","license":"MIT","author":{"name":"Steven Vachon","email":"contact@svachon.com","url":"https://www.svachon.com/"},"contributors":[{"name":"Guillaume Chau","email":"guillaume.b.chau@gmail.com"}],"main":"lib","repository":{"type":"git","url":"git+https://github.com/Akryum/winattr.git"},"scripts":{"prepublishOnly":"yarn test","test":"yarn test:eslint && yarn test:unit","test:unit":"mocha test/ --bail --reporter spec --check-leaks","test:eslint":"eslint lib --ext .js"},"dependencies":{"fswin":"^2.17.1227"},"devDependencies":{"chai":"^4.0.0","eslint":"^4.10.0","eslint-config-standard":"^11.0.0","eslint-plugin-import":"^2.8.0","eslint-plugin-node":"^6.0.0","eslint-plugin-promise":"^3.4.0","eslint-plugin-standard":"^3.0.1","mocha":"^3.4.2"},"engines":{"node":">= 8"},"files":["lib","license"],"keywords":["attributes","file","fs","fs-stat","native","ntfs","windows"],"publishConfig":{"access":"public"},"gitHead":"9654ca469456d22ee7a23e37e6beeacd412f0da9","bugs":{"url":"https://github.com/Akryum/winattr/issues"},"homepage":"https://github.com/Akryum/winattr#readme","_id":"@akryum/winattr@3.0.0","_npmVersion":"6.1.0","_nodeVersion":"10.4.1","_npmUser":{"name":"akryum","email":"alphadelta.fg@gmail.com"},"dist":{"shasum":"c345d49f8415583897e345729c12b3503927dd11","size":5480,"noattachment":false,"key":"/@akryum/winattr/-/@akryum/winattr-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@akryum/winattr/download/@akryum/winattr-3.0.0.tgz"},"maintainers":[{"name":"akryum","email":"alphadelta.fg@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/winattr_3.0.0_1529358910917_0.025370659289885245"},"_hasShrinkwrap":false,"publish_time":1529358911022,"_cnpm_publish_time":1529358911022}},"readme":"# winattr [![NPM Version][npm-image]][npm-url] [![Linux Build][travis-image]][travis-url] [![Windows Build][appveyor-image]][appveyor-url] [![Dependency Status][david-image]][david-url]\r\n\r\n> Foolproof Windows® file attributes for Node.js\r\n\r\nGet and set:\r\n* `archive`\r\n* `hidden`\r\n* `readonly`\r\n* `system`\r\n\r\n… on files and/or directories.\r\n\r\nA native binding is used, offering great performance. As a contingency in case that fails, functionality will silently revert to a command line, though it is considerably slower.\r\n\r\n\r\n## Installation\r\n\r\nIt may go without saying, but this library is not intended to run on anything other than Windows.\r\n\r\n[Node.js](http://nodejs.org/) `>= 4` is required. To install, type this at the command line:\r\n\r\n```\r\nnpm install @akryum/winattr\r\n```\r\n\r\nOr:\r\n\r\n```\r\nyarn add @akryum/winattr\r\n```\r\n\r\n## Usage\r\n\r\n### `get(path, callback)`\r\n`path` - Path to file or directory\r\n`callback(err,attrs)` - A callback which is called upon completion\r\n```js\r\nwinattr.get(\"path/to/file.ext\", function(err, attrs) {\r\n\tif (err == null) console.log(attrs);\r\n});\r\n```\r\n\r\nIf you omit the callback, a Promise will be return instead.\r\n\r\n### `getSync(path)`\r\n`path` - Path to file or directory\r\n\r\nReturns an `Object` or throws an error if the file or dir cannot be found/accessed.\r\n```js\r\nvar attrs = winattr.getSync(\"path/to/file.ext\");\r\n\r\nconsole.log(attrs);\r\n```\r\n\r\n### `set(path, attrs, callback)`\r\n`path` - Path to file or directory\r\n`attrs` - An object containing attributes to change\r\n`callback(err)` - A callback which is called upon completion\r\n```js\r\nwinattr.set(\"path/to/folder/\", {readonly:true}, function(err) {\r\n\tif (err == null) console.log(\"success\");\r\n});\r\n```\r\n\r\nIf you omit the callback, a Promise will be return instead.\r\n\r\n### `setSync(path, attrs)`\r\n`path` - Path to file or directory\r\n`attrs` - An object containing attributes to change\r\n\r\nThrows an error if the file or dir cannot be found/accessed.\r\n```js\r\nwinattr.setSync(\"path/to/folder/\", {readonly:true});\r\n```\r\n\r\n[npm-image]: https://img.shields.io/npm/v/winattr.svg\r\n[npm-url]: https://npmjs.com/package/winattr\r\n[travis-image]: https://img.shields.io/travis/stevenvachon/winattr.svg?label=linux\r\n[travis-url]: https://travis-ci.org/stevenvachon/winattr\r\n[appveyor-image]: https://img.shields.io/appveyor/ci/stevenvachon/winattr.svg?label=windows\r\n[appveyor-url]: https://ci.appveyor.com/project/stevenvachon/winattr\r\n[david-image]: https://img.shields.io/david/stevenvachon/winattr.svg\r\n[david-url]: https://david-dm.org/stevenvachon/winattr\r\n","_attachments":{},"homepage":"https://github.com/Akryum/winattr#readme","bugs":{"url":"https://github.com/Akryum/winattr/issues"},"license":"MIT"}