{"id":13670853,"url":"https://github.com/fabioricali/nuk","last_synced_at":"2025-05-07T08:28:39.569Z","repository":{"id":57312348,"uuid":"146631917","full_name":"fabioricali/nuk","owner":"fabioricali","description":"A package manager that installs only what you need.","archived":false,"fork":false,"pushed_at":"2024-10-10T15:25:59.000Z","size":100,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-24T02:17:12.008Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://fabioricali.github.io/nuk/","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/fabioricali.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-08-29T17:00:56.000Z","updated_at":"2024-10-10T15:26:01.000Z","dependencies_parsed_at":"2024-10-23T22:59:19.898Z","dependency_job_id":"0936106d-5f89-45d3-9a3c-76cf01f8d294","html_url":"https://github.com/fabioricali/nuk","commit_stats":{"total_commits":65,"total_committers":2,"mean_commits":32.5,"dds":0.07692307692307687,"last_synced_commit":"fa6624b57a5eee3c1cbb1eefb3f2107125adef1d"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabioricali%2Fnuk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabioricali%2Fnuk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabioricali%2Fnuk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabioricali%2Fnuk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabioricali","download_url":"https://codeload.github.com/fabioricali/nuk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222688211,"owners_count":17023296,"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-08-02T09:00:50.756Z","updated_at":"2024-11-02T08:06:37.510Z","avatar_url":"https://github.com/fabioricali.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# 💣nuk\nA package manager that installs only what you need.\n\n## Motivation\nIt often happens to add resources hosted on CDN to websites or web applications. CDNs, I know, are very convenient and \nquick to include a lib. But how safe is it to do it? How many times does it happen that these are unreachable \nfor traffic reasons? For example, it happens to me with unkpg.com. Get the files from the node_modules folder? No! \nit is not done. Too big. So I thought of creating a simple package manager (I don't know if I can call it that) that \nsimply downloads the resources you want in a folder.\n\n***The files should be kept \"local\". If you have your own CDN, even better.*** 😎\n\n## Installation\n```\n$ npm install -g nuk\n```\n\n## Usage\n\nDo you need to install only the UMD version of React?\n```\n$ nuk install react/umd\n```\n\nAfter this a `vendors/react/umd` folder will be created with only the files of the React umd folder present in the package on npm.\nNow, you can include your file:\n```html\n\u003cscript src=\"vendors/react/umd/react.production.min.js\"\u003e\u003c/script\u003e\n```\n\nPS: if it doesn't already exist, a configuration file called `nuk.json` will be automatically created. This serves as \na configuration.\n\n**Please don't remove** `nuk-lock.json` useful for keeping track of installed packages.\n\nYou can also install multiple packages\n```\n$ nuk install react/umd doz/dist\n```\n\nObviously you can install the version you want (**recommended**):\n```\n$ nuk install react@16.12.0/umd\n```\n\nFor updating the package to the latest version use `update`\n```\n$ nuk update react\n```\n\nIf you want to know quickly which files you can include in a given package then you can use `list`:\n```\n$ nuk list react\n```\n\nYou will receive an output like this:\n```\nnuk install react/cjs\nnuk install react/cjs/react.development.js\nnuk install react/cjs/react.production.min.js\nnuk install react/index.js\nnuk install react/index.min.js\nnuk install react/umd\nnuk install react/umd/react.development.js\nnuk install react/umd/react.production.min.js\nnuk install react/umd/react.profiling.min.js\n```\n\nI understand that inserting so many scripts into your html page could be tiring. So nuk gives you another command called \n\"bundle\". This command will only take minified files that conventionally have \"min.\" in the file name and will concatenate \nthem into one file bundle.js and bundle.css. It does nothing else. \n**It is not a real bundler**. The files will be created inside the \"vendors\" folder.\n```\n$ nuk bundle\n```\n\nif you need to exclude certain files or change the order in which nuk generates the bundle then you can add \nthe \"bundleFiles\" property to your nuk.json:\n```json\n{\n  \"bundleFiles\": [\n    \"swiper/css/swiper.min.css\",\n    \"react/umd/react.production.min.js\"  \n  ]\n}\n```\n\nIt will provide two files:\n- vendors/bundle.js\n- vendors/bundle.css\n\nSo, you can include just this:\n```html\n\u003cscript src=\"vendors/bundle.js\"\u003e\u003c/script\u003e\n\u003clink href=\"vendors/bundle.css\" rel=\"stylesheet\" type=\"text/css\"\u003e\n```\n\nif you need to diversify the bundles you can then do so:\n```json\n{\n    \"bundleFiles\": {\n        \"bundle1\": [\n            \"swiper/css/swiper.min.css\",\n            \"react/umd/react.production.min.js\"\n        ],\n        \"bundle2\": [\n            \"react/umd/react.profiling.min.js\"\n        ]\n    }\n}\n```\n\nIn this case it will provide three files:\n- vendors/bundle1.js\n- vendors/bundle1.css\n- vendors/bundle2.js\n\nDo you need to uninstall?\n```\n$ nuk uninstall react\n```\n\nif you need to change the name of the vendors folder then add this property to the nuk.json file:\n```json\n{\n  \"folderName\": \"my-vendors\"\n}\n```\n\n## Changelog\nYou can view the changelog \u003ca target=\"_blank\" href=\"https://github.com/fabioricali/nuk/blob/master/CHANGELOG.md\"\u003ehere\u003c/a\u003e\n\n## License\nnuk is open-sourced software licensed under the \u003ca target=\"_blank\" href=\"http://opensource.org/licenses/MIT\"\u003eMIT license\u003c/a\u003e\n\n## Author\n\u003ca target=\"_blank\" href=\"http://rica.li\"\u003eFabio Ricali\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabioricali%2Fnuk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabioricali%2Fnuk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabioricali%2Fnuk/lists"}