{"id":15042916,"url":"https://github.com/sindresorhus/gulp-chmod","last_synced_at":"2025-04-09T16:15:35.544Z","repository":{"id":14789891,"uuid":"17511888","full_name":"sindresorhus/gulp-chmod","owner":"sindresorhus","description":"Change permissions of Vinyl files","archived":false,"fork":false,"pushed_at":"2023-10-31T20:47:52.000Z","size":27,"stargazers_count":39,"open_issues_count":0,"forks_count":9,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-09T16:15:30.630Z","etag":null,"topics":["chmod","gulp-plugin","javascript","nodejs","vinyl"],"latest_commit_sha":null,"homepage":null,"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/sindresorhus.png","metadata":{"funding":{"github":"sindresorhus","open_collective":"sindresorhus","custom":"https://sindresorhus.com/donate"},"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/security.md","support":null,"governance":null}},"created_at":"2014-03-07T11:22:03.000Z","updated_at":"2025-02-07T16:34:50.000Z","dependencies_parsed_at":"2022-08-19T14:52:04.631Z","dependency_job_id":"71236727-7c9a-47bd-a3d5-b2b260a7b64c","html_url":"https://github.com/sindresorhus/gulp-chmod","commit_stats":{"total_commits":39,"total_committers":4,"mean_commits":9.75,"dds":0.07692307692307687,"last_synced_commit":"8c53d7a266ce1dfe0d9e1f60c5ca99fb515ffd3e"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fgulp-chmod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fgulp-chmod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fgulp-chmod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fgulp-chmod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/gulp-chmod/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065282,"owners_count":21041872,"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":["chmod","gulp-plugin","javascript","nodejs","vinyl"],"created_at":"2024-09-24T20:48:18.279Z","updated_at":"2025-04-09T16:15:35.498Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://sindresorhus.com/donate"],"categories":[],"sub_categories":[],"readme":"# gulp-chmod\n\n\u003e [Change permissions](https://en.wikipedia.org/wiki/Chmod) of [Vinyl](https://github.com/gulpjs/vinyl) files\n\n## Install\n\n```sh\nnpm install --save-dev gulp-chmod\n```\n\n## Usage\n\n```js\nimport gulp from 'gulp';\nimport chmod from 'gulp-chmod';\n\nexport default () =\u003e (\n\tgulp.src('src/app.js')\n\t\t.pipe(chmod(0o755))\n\t\t.pipe(gulp.dest('dist'))\n);\n```\n\nor\n\n```js\nimport gulp from 'gulp';\nimport chmod from 'gulp-chmod';\n\nexport default () =\u003e (\n\tgulp.src('src/app.js')\n\t\t.pipe(chmod({\n\t\t\towner: {\n\t\t\t\tread: true,\n\t\t\t\twrite: true,\n\t\t\t\texecute: true\n\t\t\t},\n\t\t\tgroup: {\n\t\t\t\texecute: true\n\t\t\t},\n\t\t\tothers: {\n\t\t\t\texecute: true\n\t\t\t}\n\t\t}))\n\t\t.pipe(gulp.dest('dist'))\n);\n```\n\n## API\n\n### chmod(fileMode, directoryMode?)\n\n#### fileMode\n\nType: `number | object`\n\nCan either be a [chmod](https://ss64.com/bash/chmod.html) octal number or an object with the individual permissions specified.\n\nValues depends on the current file, but these are the possible keys:\n\n```js\n{\n\towner: {\n\t\tread: true,\n\t\twrite: true,\n\t\texecute: true\n\t},\n\tgroup: {\n\t\tread: true,\n\t\twrite: true,\n\t\texecute: true\n\t},\n\tothers: {\n\t\tread: true,\n\t\twrite: true,\n\t\texecute: true\n\t}\n}\n```\n\nWhen `read`, `write`, and `execute` are the same, you can simplify the object:\n\n```js\n{\n\tread: true\n}\n```\n\nPass `undefined` to not set permissions on files. Useful if you only want to set permissions on directories.\n\n#### directoryMode\n\nType: `true | number | object`\n\nSame as `fileMode`, but applies to directories.\n\nSpecify `true` to use the same value as `fileMode`.\n\n## Tip\n\nCombine it with [gulp-filter](https://github.com/sindresorhus/gulp-filter) to only change permissions on a subset of the files.\n\n```js\nimport gulp from 'gulp';\nimport chmod from 'gulp-chmod';\nimport gulpFilter from 'gulp-filter';\n\nconst filter = gulpFilter('src/cli.js', {restore: true});\n\nexport default = () =\u003e (\n\tgulp.src('src/*.js')\n\t\t// Filter a subset of the files\n\t\t.pipe(filter)\n\t\t// Make them executable\n\t\t.pipe(chmod(0o755))\n\t\t// Bring back the previously filtered out files\n\t\t.pipe(filter.restore)\n\t\t.pipe(gulp.dest('dist'))\n);\n```\n\n## Related\n\n- [gulp-chown](https://github.com/sindresorhus/gulp-chown) - Change owner of Vinyl files\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fgulp-chmod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fgulp-chmod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fgulp-chmod/lists"}