{"id":18029250,"url":"https://github.com/std-microblock/nbundle","last_synced_at":"2025-10-29T19:50:33.250Z","repository":{"id":130218320,"uuid":"505194949","full_name":"std-microblock/NBundle","owner":"std-microblock","description":"Simple bundler, for Tamper Monkey plugins and BetterNCM plugins","archived":false,"fork":false,"pushed_at":"2022-06-20T18:18:51.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-10T05:29:12.245Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/std-microblock.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-19T18:56:56.000Z","updated_at":"2022-06-19T18:57:17.000Z","dependencies_parsed_at":"2023-03-14T12:30:39.022Z","dependency_job_id":null,"html_url":"https://github.com/std-microblock/NBundle","commit_stats":null,"previous_names":["std-microblock/nbundle"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/std-microblock%2FNBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/std-microblock%2FNBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/std-microblock%2FNBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/std-microblock%2FNBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/std-microblock","download_url":"https://codeload.github.com/std-microblock/NBundle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247249543,"owners_count":20908212,"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-10-30T09:08:38.352Z","updated_at":"2025-10-29T19:50:33.143Z","avatar_url":"https://github.com/std-microblock.png","language":"Rust","readme":"# NBundle\nSimple bundler, for Tamper Monkey plugins and BetterNCM plugins\n\n一个简单的可以将多个文件转换为单文件的程序。支持实时更新。\n\n速度极快，调试顺畅。\n\n# 何时使用？\n当你正在制作一个复杂的Tampermonkey插件，想要进行分文件开发，使用less等语言。\n\n当你在写一个BetterDiscord/BetterNCM插件，想要将html文件独立出来\n\n# 使用\n## 1.配置命令行\n```\nNBundle 1.0\nMicroBlock\nBundle everything to one javascript file.\n\nUSAGE:\n    nbundle [OPTIONS] --dir \u003cDir\u003e --output \u003cOutput\u003e\n\nOPTIONS:\n    -d, --dir \u003cDir\u003e          Sets the monitoring dir. | 设置监控的文件夹\n    -h, --help               Print help information | 打印帮助信息\n    -m, --main \u003cMain\u003e        Sets the main file. | 设置入口文件（默认为main.js）\n    -o, --output \u003cOutput\u003e    Sets the output file. | 设置输出文件\n    -V, --version            Print version information | 打印版本信息\n```\n\n程序将会监控指定文件夹下的所有变动。\n\n如：将当前目录下，以`main.js`为入口点，打包为上级目录下`livesongplayer-bundled.js`，写为：\n\n```\nnbundle.exe --dir ./ --output ../livesongplayer-bundled.js\n```\n## 2.语法\n### 字符串型\n例：`\"#require /www/foo.js#\"`\n\n该种类型将会保持字符串类型。\n\n如：\n\n编译前：\n```js\n// main.js\nconsole.log(\"#require /foo.txt#\")\n\n// foo.txt\nbar\n```\n编译后：\n```js\n// bundled.js\nwindow['nbundle-build-xx']={\"nbundle-string-match-xx\":\"bar\"}\nconsole.log(window['nbundle-build-xx'][\"nbundle-string-match-xx\"])\n```\n或\n```js\nconsole.log(\"bar\")\n```\n\n### 注释型\n该种类型将不保留注释\n\n如：\n\n编译前：\n```js\n// main.js\nconsole.log(\"Main.js\")\n/*#require /a.js#*/\n\n// a.js\nconsole.log(\"NBundle!\");\n```\n编译后：\n```js\n// bundled.js\nconsole.log(\"Main.js\")\n(function(){console.log(\"NBundle!\");})()\n```\n\n## 3.指令\n### require\n - 正常的引用指令\n - 可能视情况进行优化\n - 例：\n `/*#require /a.js#*/`-\u003e`(function(){console.log(\"NBundle!\");})()`\n### raw_require\n - 直接替换\n - 例：\n `/*#raw_require /a.js#*/`-\u003e`console.log(\"NBundle!\");`\n\n## 4.使用例\nhttps://github.com/MicroCBer/NeteaseLiveSongPlayer\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstd-microblock%2Fnbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstd-microblock%2Fnbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstd-microblock%2Fnbundle/lists"}