{"id":18669961,"url":"https://github.com/blahah/electron-renderify","last_synced_at":"2025-04-12T00:31:10.447Z","repository":{"id":26266924,"uuid":"107799135","full_name":"blahah/electron-renderify","owner":"blahah","description":"Browserify transform to allow bundling for Electron renderer processes","archived":false,"fork":false,"pushed_at":"2023-01-12T08:26:31.000Z","size":118,"stargazers_count":17,"open_issues_count":3,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-08T14:12:29.072Z","etag":null,"topics":["browserify","browserify-transform","electron","nodejs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blahah.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}},"created_at":"2017-10-21T17:05:23.000Z","updated_at":"2023-03-24T13:02:22.000Z","dependencies_parsed_at":"2023-01-14T04:18:23.966Z","dependency_job_id":null,"html_url":"https://github.com/blahah/electron-renderify","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blahah%2Felectron-renderify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blahah%2Felectron-renderify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blahah%2Felectron-renderify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blahah%2Felectron-renderify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blahah","download_url":"https://codeload.github.com/blahah/electron-renderify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223486766,"owners_count":17153240,"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":["browserify","browserify-transform","electron","nodejs"],"created_at":"2024-11-07T08:49:20.283Z","updated_at":"2024-11-07T08:49:20.823Z","avatar_url":"https://github.com/blahah.png","language":"JavaScript","readme":"---\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eelectron-renderify\u003c/h1\u003e\n  \u003ch2\u003eBrowserify transform to allow bundling for Electron renderer processes\u003c/h2\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://npmjs.com/packages/electron-renderify\" alt=\"npm package\"\u003e\n      \u003cimg src=\"https://img.shields.io/npm/v/electron-renderify.svg?style=flat-square\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/blahah/electron-renderify/blob/master/LICENSE\" alt=\"CC0 public domain\"\u003e\n      \u003cimg src=\"https://img.shields.io/badge/license-CC0-ff69b4.svg?style=flat-square\"\u003e\n    \u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n---\n\nPrefix calls to `require` as `window.require` for node and electron built-in modules.  This allows them to work as you would expect in electron processes.\n\n## Install\n\n```\nnpm install electron-renderify\n```\n\n## Usage\n\nThis module is to be used as a [browserify]() transform.\n\nDepending on what is in your bundle, and how you are setting up Electron, you may need to apply some or all of the following browserify settings:\n\n```js\n{\n  builtins: [],\n  commonDir: false,\n  detectGlobals: false,\n  ignoreMissing: true,\n  insertGlobalVars: 'global',\n  browserField: false\n}\n```\n\nThe best place to apply the settings is in your `package.json`. That way they will take effect with either CLI or JS api use.\n\n### CLI\n\n```bash\nbrowserify -t electron-renderify sample.js \u003e bundle.js\n```\n\n### JS\n\n```js\nvar browserify = require('browserify')\nvar renderify = require('electron-renderify')\n\nvar path = require('path')\n\nbrowserify()\n  .transform(renderify)\n  .add(path.join(__dirname, 'sample.js'))\n  .bundle()\n  .pipe(process.stdout)\n```\n\n## Options\n\nYou can modify the behaviour of `electron-renderify` by passing options to the transform, like this:\n\n```js\nbrowserify()\n  .transform(renderify, opts)\n```\n\nThe following options are available:\n\n### `opts.windowRequire` [Array[String]]\n\nAn array of strings, each of which specifies a module that should use `window.require` instead of plain `require`. This might be required for any native modules (although you should consider moving any such dependencies to the main process).\n\nExample:\n\n```js\nvar browserify = require('browserify')\nvar renderify = require('electron-renderify')\n\nvar path = require('path')\n\nvar renderifyOpts = {\n  windowRequire: ['leveldown']\n}\n\nbrowserify()\n  .transform(renderify, renderifyOpts)\n  .add('somefile-requiring-leveldown.js')\n  .bundle()\n  .pipe(process.stdout)\n```\n\n## License\n\nTo the extent possible by law, we transfer any rights we have in this code to the public domain. Specifically, we do so using the [CC0 1.0 Universal Public Domain Dedication](https://creativecommons.org/publicdomain/zero/1.0/).\n\nYou can do whatever you want with this code. No need to credit us, link to us, include any license, or anything else. But if you want to do those things, you're free to do that too.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblahah%2Felectron-renderify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblahah%2Felectron-renderify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblahah%2Felectron-renderify/lists"}