{"id":23031868,"url":"https://github.com/rookiemonkey/boilerplate-npm_on_browser","last_synced_at":"2025-04-02T21:40:51.713Z","repository":{"id":158000390,"uuid":"313468220","full_name":"rookiemonkey/boilerplate-npm_on_browser","owner":"rookiemonkey","description":":wrench: :hammer:  An example on how to use node modules on browser instead of a nodejs environment. WARNING :bangbang: not all node modules will work on browsers","archived":false,"fork":false,"pushed_at":"2020-11-17T01:18:29.000Z","size":51,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-08T12:12:56.962Z","etag":null,"topics":["boilerplate","browserify","template"],"latest_commit_sha":null,"homepage":"","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/rookiemonkey.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":"2020-11-17T01:00:40.000Z","updated_at":"2021-01-19T03:34:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"757c5b6c-28f5-4044-bfd8-744bd5caf256","html_url":"https://github.com/rookiemonkey/boilerplate-npm_on_browser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rookiemonkey%2Fboilerplate-npm_on_browser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rookiemonkey%2Fboilerplate-npm_on_browser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rookiemonkey%2Fboilerplate-npm_on_browser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rookiemonkey%2Fboilerplate-npm_on_browser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rookiemonkey","download_url":"https://codeload.github.com/rookiemonkey/boilerplate-npm_on_browser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246899617,"owners_count":20851893,"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":["boilerplate","browserify","template"],"created_at":"2024-12-15T15:47:28.051Z","updated_at":"2025-04-02T21:40:51.662Z","avatar_url":"https://github.com/rookiemonkey.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n1. require the npm package the you need\n```\nconst Buffer = require('buffer').Buffer\n```\n\n2. Append the variable to the window object\n```\nglobal.window.Buffer = Buffer\n```\n\n3. Install browserify as devDep\n```\nyarn add browserify -D\n```\n\n4. Compile your main.js file using browserify\n```\nbrowserify main.js -o output.js\n```\n\n5. use your output.js on your html\n```\n\u003cscript src=\"output.js\" \u003e\u003c/script\u003e\n```\n\n6. run it on live server and check the window object on console if your npm\npackage is present (in this example, it is Buffer)\n![](./screenshot/screen.jpg)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frookiemonkey%2Fboilerplate-npm_on_browser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frookiemonkey%2Fboilerplate-npm_on_browser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frookiemonkey%2Fboilerplate-npm_on_browser/lists"}