{"id":21456873,"url":"https://github.com/gregonnet/npm-package-select","last_synced_at":"2025-07-06T12:35:56.572Z","repository":{"id":143901736,"uuid":"55362336","full_name":"GregOnNet/npm-package-select","owner":"GregOnNet","description":"Selects files inside node_modules/ reading a configuration file","archived":false,"fork":false,"pushed_at":"2016-04-04T18:33:42.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-29T04:45:24.898Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GregOnNet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-03T18:37:49.000Z","updated_at":"2016-04-03T21:44:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"130d6758-7432-4d98-82dc-3cd97013c0f7","html_url":"https://github.com/GregOnNet/npm-package-select","commit_stats":{"total_commits":37,"total_committers":1,"mean_commits":37.0,"dds":0.0,"last_synced_commit":"809191646f3db2ac0896cb051b6ac51af209483b"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/GregOnNet/npm-package-select","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GregOnNet%2Fnpm-package-select","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GregOnNet%2Fnpm-package-select/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GregOnNet%2Fnpm-package-select/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GregOnNet%2Fnpm-package-select/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GregOnNet","download_url":"https://codeload.github.com/GregOnNet/npm-package-select/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GregOnNet%2Fnpm-package-select/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263901409,"owners_count":23527403,"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":[],"created_at":"2024-11-23T05:17:00.446Z","updated_at":"2025-07-06T12:35:56.512Z","avatar_url":"https://github.com/GregOnNet.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# npm-package-select\r\n\r\nSelect files inside node_modules/ reading a configuration file.\r\n\r\nThis module allows the selection of certain files of a `npm-package`.\r\nIt can be used with [gulp](https://www.npmjs.com/package/gulp) to copy distribution files of packages to any destination you want.\r\nA configuration file is used to specify all needed sources.\r\n\r\n## Install\r\n\r\n```\r\n$ npm install --save-dev npm-package-select\r\n```\r\n\r\n## Prerequisites\r\n\r\nMake sure that all configured packages are installed. `npm-package-select`  cannot download a missing package.\r\n\r\n## Usage\r\n\r\n1. Create a `npmconfig.json` specifying all needed files. The path of each file is relative to the corresponding npm-package.\r\n\r\n    **Example** The compiled source of  [requirejs](https://www.npmjs.com/package/requirejs) is located in `bin/r.js`. If you want to use requirejs you have to use the mentioned path before.\r\n    In this sample `js` and `css` represent **groups**. Groups give the possibility to copy the specified sources into different destination directories.\r\n\r\n    ```json\r\n    {\r\n      \"js\": [{\r\n        \"requirejs\": {\r\n          \"files\": [\"bin/r.js\"]\r\n        }\r\n      }],\r\n      \"css\": [{\r\n        \"semantic-ui-css\": {\r\n          \"files\": [\"semantic.css\"]\r\n        }\r\n      }]\r\n    }\r\n    ```\r\n\r\n2. Create a gulp task to copy the selected files to copy them to any destination.\r\n\r\n    ```js\r\n    import {Gulpclass, Task, SequenceTask} from 'gulpclass/Decorators';\r\n    import * as gulp from 'gulp';\r\n\r\n    // Initialize npm-package-select\r\n    const NpmPackageSelect = require('npm-package-select');\r\n\r\n    @Gulpclass()\r\n    export class Gulpfile {\r\n\r\n      @Task('default', ['link'])\r\n      default() { }\r\n\r\n      @Task()\r\n      link(done: Function) {\r\n        // Read npmconfig.json\r\n        let selection = new NpmPackageSelect('./npmconfig.json');\r\n\r\n        // Read all groups of npmconfig.json\r\n        selection.groups().forEach(group =\u003e {\r\n\r\n          // Read all packages of a group\r\n          group.packages.forEach(p =\u003e {\r\n\r\n            // Pipe files of the package to a specified destination\r\n            gulp.src(p.files)\r\n                .pipe(gulp.dest(`./content/assets/${group.name}/${p.name}`));\r\n          })\r\n        });\r\n\r\n        done();\r\n      }\r\n    }\r\n    ```\r\n    \u003e This gulpfile is written with [gulpclass](https://www.npmjs.com/package/gulpclass).\r\n\r\n## Issues\r\n\r\nIf you notice an error or unexpected behavior than please [open an issue](https://github.com/GregOnNet/npm-package-select/issues) on GitHub.\r\nIdeas and pull-requests are welcome as well.\r\n\r\nThank you.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregonnet%2Fnpm-package-select","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgregonnet%2Fnpm-package-select","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregonnet%2Fnpm-package-select/lists"}