BROWSER-INSERT-MODULE-GLOBALS(1)
π browser-insert-module-global(1) β the manual, but make it cute
okay bestie, welcome to the browser-insert-module-global page from the <rainbow>browserify</rainbow> corner of the manual. this one is a lil tool, not a whole vibe, but she's important. let's go π
β¨ NAME β¨
browser-insert-module-global β browserify tools to insert global module list π«Ά
β¨ SYNOPSIS β¨
browser-insert-module-global [file]
β¨ DESCRIPTION β¨
so, what does she actually do? browser-insert-module-global packs node-style source files' dependencies. that's the whole job, and she does it with main character energy. π
here's the tea, fr fr: browser-insert-module-global takes a javascript file as input, and gives you back a transformed javascript file β with a closure wrapped around the contents whenever that's necessary, so that extra builtins can be defined. cute, right? π
and by default? she reads from STDIN. no arguments needed, she'll just vibe with whatever you pipe in. π¦
β¨ EXAMPLES β¨
here's the iconic pipeline, copy it exactly bestie, no cap:
browser-module-deps /usr/share/doc/node-insert-module-globals/examples/main.js | browser-insert-module-globals | browser-pack | node
and the output from that run, verbatim:
in main.js: {"__filename":"/main.js","__dirname":"/"}
in foo/index.js: {"__filename":"/foo/index.js","__dirname":"/foo"}
likeβ¦ look at that. __filename and __dirname getting their little moments. obsessed. β¨
heads up: the example callsbrowser-insert-module-globalswith anson the end, and the page you're reading isbrowser-insert-module-globalwithout one. that's just how the original is written, so i'm keeping it exactly as-is β i don't make the rules, i just write them down π
β¨ SEE ALSO β¨
browserify(1)browser-module-depsbrowser-pack(1)nodejs(1)
go read those too, bestie, they're the rest of the friend group π
that's the whole page!! she's from 8/4/17, source line says browser-insert-module-global(1), and that's the version + date sign-off. bye babe, go pipe something into stdin π
π¦ where this page comes from
- debian bookworm: node-debbundle-insert-module-globals 7.2.1+ds+~cs4.3.4-6 Β· MIT
- debian trixie: node-debbundle-insert-module-globals 7.2.1+ds+~cs4.3.4-6 Β· MIT
- ubuntu jammy: node-debbundle-insert-module-globals 7.2.1+ds+~cs4.3.4-3 Β· MIT
- ubuntu noble: node-debbundle-insert-module-globals 7.2.1+ds+~cs4.3.4-6 Β· MIT
- ubuntu resolute: node-debbundle-insert-module-globals 7.2.1+ds+~cs4.3.4-6 Β· MIT
- ubuntu stonking: node-debbundle-insert-module-globals 7.2.1+ds+~cs4.3.4-9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms