{"id":15287809,"url":"https://github.com/electerious/rosid-handler-js","last_synced_at":"2025-07-24T23:14:12.251Z","repository":{"id":65412147,"uuid":"48660932","full_name":"electerious/rosid-handler-js","owner":"electerious","description":"Load, transform, bundle and compress JS.","archived":false,"fork":false,"pushed_at":"2024-07-13T06:33:32.000Z","size":93,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-08T18:38:58.779Z","etag":null,"topics":["babel","browserify","js","rosid","transpiler","uglify"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/electerious.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2015-12-27T21:21:43.000Z","updated_at":"2022-01-08T15:50:50.000Z","dependencies_parsed_at":"2024-10-23T01:33:13.053Z","dependency_job_id":null,"html_url":"https://github.com/electerious/rosid-handler-js","commit_stats":{"total_commits":177,"total_committers":4,"mean_commits":44.25,"dds":"0.10734463276836159","last_synced_commit":"3f9fb371aa560c575e410498ba36268bdcc93045"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/electerious/rosid-handler-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electerious%2Frosid-handler-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electerious%2Frosid-handler-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electerious%2Frosid-handler-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electerious%2Frosid-handler-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/electerious","download_url":"https://codeload.github.com/electerious/rosid-handler-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electerious%2Frosid-handler-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266922094,"owners_count":24006968,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["babel","browserify","js","rosid","transpiler","uglify"],"created_at":"2024-09-30T15:38:04.027Z","updated_at":"2025-07-24T23:14:12.212Z","avatar_url":"https://github.com/electerious.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rosid-handler-js\n\n[![Travis Build Status](https://travis-ci.org/electerious/rosid-handler-js.svg?branch=master)](https://travis-ci.org/electerious/rosid-handler-js) [![Coverage Status](https://coveralls.io/repos/github/electerious/rosid-handler-js/badge.svg?branch=master)](https://coveralls.io/github/electerious/rosid-handler-js?branch=master) [![Dependencies](https://david-dm.org/electerious/rosid-handler-js.svg)](https://david-dm.org/electerious/rosid-handler-js#info=dependencies) [![Greenkeeper badge](https://badges.greenkeeper.io/electerious/rosid-handler-js.svg)](https://greenkeeper.io/)\n\nA function that loads a JS file and transforms, bundles and compresses its content.\n\n## Install\n\n```\nnpm install rosid-handler-js\n```\n\n## Usage\n\n### API\n\n```js\nconst handler = require('rosid-handler-js')\n\nhandler('main.js').then((data) =\u003e {})\nhandler('main.js', { optimize: true }).then((data) =\u003e {})\n```\n\n### Rosid\n\nAdd the following object to your `rosidfile.json`, `rosidfile.js` or [routes array](https://github.com/electerious/Rosid/blob/master/docs/Routes.md). `rosid-handler-js` will transform, bundles and compresses all matching JS files in your source folder.\n\n```json\n{\n  \"name\"    : \"JS\",\n  \"path\"    : \"[^_]*.js\",\n  \"handler\" : \"rosid-handler-js\"\n}\n```\n\n```js\n// main.js\nexport default () =\u003e 'Hello World'\n```\n\n```js\n// main.js (output)\n\"use strict\"\nObject.defineProperty(exports,\"__esModule\",{value:!0}),exports[\"default\"]=function(){return\"Hello World\"}\n```\n\n## Parameters\n\n- `filePath` `{String}` Absolute path to file.\n- `opts` `{?Object}` Options.\n\t- `optimize` `{?Boolean}` - Optimize output. Defaults to `false`.\n\t- `env` `{?Object}` - Environment variables for [loose-envify](https://github.com/zertosh/loose-envify). Defaults to an object with `NODE_ENV` set to `production` when `optimize` is enabled.\n\t- `browserify` `{?Object}` - Browserify [options](https://github.com/browserify/browserify). Defaults to an object with `debug` enabled.\n\t- `babel` `{?Object}` - Babel [options](https://babeljs.io/docs/usage/api/). Defaults to an object with the presets [env](http://babeljs.io/docs/plugins/preset-env/) and [react](http://babeljs.io/docs/plugins/preset-react/).\n\n## Returns\n\n- `{Promise\u003cString|Buffer\u003e}` The transformed file content.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felecterious%2Frosid-handler-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felecterious%2Frosid-handler-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felecterious%2Frosid-handler-js/lists"}