{"id":19560616,"url":"https://github.com/zoubin/gulp-exports","last_synced_at":"2025-02-26T08:41:26.644Z","repository":{"id":30419449,"uuid":"33972356","full_name":"zoubin/gulp-exports","owner":"zoubin","description":"expose api module.exports to some given host object","archived":false,"fork":false,"pushed_at":"2015-04-16T02:03:28.000Z","size":140,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T09:32:56.475Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"egrcc/zhihu-python","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoubin.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}},"created_at":"2015-04-15T04:03:01.000Z","updated_at":"2015-04-16T02:03:29.000Z","dependencies_parsed_at":"2022-08-25T21:22:44.275Z","dependency_job_id":null,"html_url":"https://github.com/zoubin/gulp-exports","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/zoubin%2Fgulp-exports","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fgulp-exports/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fgulp-exports/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fgulp-exports/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoubin","download_url":"https://codeload.github.com/zoubin/gulp-exports/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240822615,"owners_count":19863302,"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-11-11T05:08:17.098Z","updated_at":"2025-02-26T08:41:26.587Z","avatar_url":"https://github.com/zoubin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gulp-exports\nExpose module.exports to a global object, like `window` in the browser envrionment.\n\n## Deprecated\nuse [gulp-expose](https://github.com/zoubin/gulp-expose) instead\n## install\n```\nnpm install --save-dev gulp-exports\n```\n\n## usage\n\n### number.js\n```\nmodule.exports = 1;\n```\n\n### build\n\n```javascript\nvar gulp = require('gulp');\nvar wrap = require('gulp-exports');\ngulp.src('number.js')\n    .pipe(wrap('window', 'One'))\n    .pipe(gulp.dest('dist'));\n```\n\n### dist/number.js\n\n```javascript\n(function (module, exports) {\n   var _exports = module.exports;\n   module.exports = module[\"One\"] || {};\n   exports = module[\"One\"] = module.exports;\n   /****** code begin *********/\nmodule.exports = 1;\n\n   /****** code end *********/\n   if (typeof _exports === \"undefined\") {\n       delete module.exports;\n   } else if (\"One\" !== \"exports\") {\n       module.exports = _exports;\n   }\n}).call(window, window, window[\"One\"]);\n\n```\n\nNow in browser:\n\n```\nwindow.One === 1; // true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Fgulp-exports","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoubin%2Fgulp-exports","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Fgulp-exports/lists"}