{"id":15655622,"url":"https://github.com/stevenvachon/winattr","last_synced_at":"2025-06-29T14:32:06.326Z","repository":{"id":19249500,"uuid":"22484863","full_name":"stevenvachon/winattr","owner":"stevenvachon","description":"Foolproof Windows® file attributes.","archived":false,"fork":false,"pushed_at":"2021-02-25T15:47:32.000Z","size":31,"stargazers_count":25,"open_issues_count":4,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-17T00:37:29.826Z","etag":null,"topics":["attributes","filesystem","nodejs","windows"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stevenvachon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-31T21:01:04.000Z","updated_at":"2025-05-10T17:14:31.000Z","dependencies_parsed_at":"2022-08-01T04:17:57.768Z","dependency_job_id":null,"html_url":"https://github.com/stevenvachon/winattr","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stevenvachon/winattr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Fwinattr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Fwinattr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Fwinattr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Fwinattr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevenvachon","download_url":"https://codeload.github.com/stevenvachon/winattr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Fwinattr/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261085533,"owners_count":23107548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["attributes","filesystem","nodejs","windows"],"created_at":"2024-10-03T13:00:05.440Z","updated_at":"2025-06-29T14:32:06.290Z","avatar_url":"https://github.com/stevenvachon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# winattr [![NPM Version][npm-image]][npm-url] [![Linux Build][travis-image]][travis-url] [![Windows Build][appveyor-image]][appveyor-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependency Monitor][greenkeeper-image]][greenkeeper-url]\n\n\u003e Foolproof Windows® file attributes for Node.js\n\nGet and set:\n* `archive`\n* `hidden`\n* `readonly`\n* `system`\n\n… on files and/or directories.\n\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.\n\n\n## Installation\n\nIt may go without saying, but this library is not intended to run on anything other than Windows.\n\n[Node.js](http://nodejs.org/) `\u003e= 8` is required. To install, type this at the command line:\n```\nnpm install winattr\n```\n\n\n## Methods\n\n### `get(path, callback)`\n`path` - Path to file or directory  \n`callback(err,attrs)` - A callback which is called upon completion  \n```js\nwinattr.get('path/to/file.ext', (err, attrs) =\u003e {\n  if (err == null) {\n    console.log(attrs);\n  }\n});\n```\n\n### `getSync(path)`\n`path` - Path to file or directory  \n\nReturns an `Object` or throws an error if the file or dir cannot be found/accessed.\n```js\nconst attrs = winattr.getSync('path/to/file.ext');\n\nconsole.log(attrs);\n```\n\n### `set(path, attrs, callback)`\n`path` - Path to file or directory  \n`attrs` - An object containing attributes to change  \n`callback(err)` - A callback which is called upon completion  \n```js\nwinattr.set('path/to/folder/', {readonly:true}, err =\u003e {\n  if (err == null) {\n    console.log('success');\n  }\n});\n```\n\n### `setSync(path, attrs)`\n`path` - Path to file or directory  \n`attrs` - An object containing attributes to change  \n\nThrows an error if the file or dir cannot be found/accessed.\n```js\nwinattr.setSync('path/to/folder/', {readonly:true});\n```\n\n\n[npm-image]: https://img.shields.io/npm/v/winattr.svg\n[npm-url]: https://npmjs.com/package/winattr\n[travis-image]: https://img.shields.io/travis/stevenvachon/winattr.svg?label=linux\n[travis-url]: https://travis-ci.org/stevenvachon/winattr\n[appveyor-image]: https://img.shields.io/appveyor/ci/stevenvachon/winattr.svg?label=windows\n[appveyor-url]: https://ci.appveyor.com/project/stevenvachon/winattr\n[coveralls-image]: https://img.shields.io/coveralls/stevenvachon/winattr.svg\n[coveralls-url]: https://coveralls.io/github/stevenvachon/winattr\n[greenkeeper-image]: https://badges.greenkeeper.io/stevenvachon/winattr.svg\n[greenkeeper-url]: https://greenkeeper.io/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenvachon%2Fwinattr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevenvachon%2Fwinattr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenvachon%2Fwinattr/lists"}