{"id":13774916,"url":"https://github.com/joakim/rollup-plugin-espruino","last_synced_at":"2026-02-04T12:51:47.156Z","repository":{"id":65472288,"uuid":"78541621","full_name":"joakim/rollup-plugin-espruino","owner":"joakim","description":"Rollup plugin for sending bundled code to an Espruino device (deprecated).","archived":false,"fork":false,"pushed_at":"2024-01-14T11:43:48.000Z","size":19,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-01T01:38:39.776Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://npm.im/rollup-plugin-espruino","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/joakim.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-10T14:34:52.000Z","updated_at":"2024-01-14T11:48:12.000Z","dependencies_parsed_at":"2024-08-03T17:09:22.176Z","dependency_job_id":"1769f7db-10f0-49a7-8f16-5ca2956a65a5","html_url":"https://github.com/joakim/rollup-plugin-espruino","commit_stats":{"total_commits":21,"total_committers":3,"mean_commits":7.0,"dds":"0.19047619047619047","last_synced_commit":"ceffe15b73dac5c76a118b8fd2a7660314b23056"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joakim%2Frollup-plugin-espruino","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joakim%2Frollup-plugin-espruino/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joakim%2Frollup-plugin-espruino/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joakim%2Frollup-plugin-espruino/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joakim","download_url":"https://codeload.github.com/joakim/rollup-plugin-espruino/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253533153,"owners_count":21923371,"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-08-03T17:01:31.728Z","updated_at":"2026-02-04T12:51:42.102Z","avatar_url":"https://github.com/joakim.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Output"],"readme":"# rollup-plugin-espruino\n\n### Deprecated\n\nUse [rollup-plugin-espruino-modules](https://github.com/opichals/rollup-plugin-espruino-modules) or [EspruinoTools' built-in rollup support](https://github.com/espruino/EspruinoTools/pull/80) instead ([discussion](https://forum.espruino.com/comments/15063250/)).\n\n---\n\n[Rollup](https://rollupjs.org/) plugin for sending bundled code to an\n[Espruino](http://www.espruino.com) device.\n\nRollup produces very lean code from modules, with treeshaking and no overhead if\nusing `es` as the output format. Perfect for Espruino.\n\nWith this plugin, bundled code will be sent to one or more Espruino devices\nafter the dest file has been written to disk. That means it requires the use of\n`bundle.write()` if running Rollup from JavaScript, or `dest` if using a\nconfiguration file. Having the file also written to disk is a good thing, as you\ncan see exactly what was sent to Espruino.\n\nAny uncaught errors in the code sent to Espruino will be shown in the terminal,\nto help with debugging.\n\nThe plugin exits the process when done, so it must be the last plugin. It should\nbe compatible with most other Rollup plugins, here are some that may be useful\nin an Espruino project:\n\n- [commonjs](https://github.com/rollup/rollup-plugin-commonjs) - adds support for [Espruino](https://www.espruino.com/Modules)/Node style modules (using `require()`)\n- [uglify](https://github.com/TrySound/rollup-plugin-uglify) - ugly minification\n- [cleanup](https://github.com/aMarCruz/rollup-plugin-cleanup) - pretty minification\n- [eslint](https://github.com/TrySound/rollup-plugin-eslint) - lints your code\n- [filesize](https://github.com/ritz078/rollup-plugin-filesize) - displays the size of the code sent to Espruino\n- [coffee-script](https://github.com/lautis/rollup-plugin-coffee-script) - `.coffee` lovers can use Espruino too!\n\n[More plugins here](https://github.com/rollup/rollup/wiki/Plugins)\n\n\n# Install\n\nUsing NPM:\n\n    npm install rollup-plugin-espruino --save\n\nUsing Yarn:\n\n    yarn add rollup-plugin-espruino\n\nSending to Espruino devices (like Puck.js) over Bluetooth LE also requires the\n[noble](https://github.com/sandeepmistry/noble) package.\n\n\n# Use\n\nExample configuration file (`rollup.config.js`):\n\n```js\nimport espruino from 'rollup-plugin-espruino'\n\nexport default {\n  input: 'src/main.js',\n  output: {\n    file:   'dist/bundle.js',\n    format: 'es',\n  },\n  plugins: [\n    espruino({\n      port: 'aa:bb:cc:dd:ee', // or ['/dev/ttyX', 'aa:bb:cc:dd:ee']\n      setTime: true,\n      save: true,\n    }),\n  ],\n}\n```\n\nMake sure the `espruino` plugin is the last.\n\nThe above configuration file would run by executing the command `rollup -c` from\nthe same directory.\n\nIt is also possible to use Rollup's [JavaScript API](https://github.com/rollup/rollup/wiki/JavaScript-API).\nIf you do, you'll have to write the bundle to disk using `bundle.write()` for\nthis plugin to run.\n\n\n# Options\n\nAll options are optional.\n\n### port\n\nSpecify port(s) or device address(es) to connect to. May either be a string or\nan array of strings.\n\nDefaults to searching for ports and picking the first found.\n\n### reset\n\nReset the Espruino device before sending code.\n\nBoolean, defaults to `true`.\n\n### save\n\nSave the code on the Espruino device after sending.\n\nBoolean, defaults to `false`.\n\n### setTime\n\nSet Espruino's clock to the current time when sending code.\n\nBoolean, defaults to `false`.\n\n### BLE\n\nConnect to Espruino devices over Bluetooth LE (requires the [noble](https://www.npmjs.com/package/noble)\npackage to be installed alongside this plugin).\n\nBoolean, defaults to `true`.\n\n### audio\n\nConnect to Espruino devices over the [headphone jack](http://www.espruino.com/Headphone).\n\nPossible values:\n\n- `0` - Disabled\n- `PP` - Normal Signal Polarity\n- `NN` - Fully Inverted\n- `NP` - Input Inverted\n- `PN` - Output Inverted\n\nDefaults to `0` (disabled).\n\n### baudRate\n\nThe baud rate that is used when connecting to Espruino devices over serial.\n\nNumber, defaults to `9600`, which is the default for Espruino.\n\n### throttle\n\nThrottle code when sending to Espruino. If you are experiencing lost characters\nwhen sending code, this may help.\n\nBoolean, defaults to `false`.\n\n### output\n\nShow output from Espruino while sending code.\n\nBoolean, defaults to `false`.\n\n### verbose\n\nShow verbose output from the underlying `espruino` package. Not pretty, but\nsometimes useful.\n\nBoolean, defaults to `false`.\n\n\n# Tips\n\n## Minification\n\nUsing `rollup-plugin-uglify` with ES modules is a little tricky, but\n[this forum post](http://forum.espruino.com/comments/13410194/) shows you how.\n\nTo achieve maximum minification, enable the `toplevel` mangle option like so:\n\n```js\n  ...\n  plugins: [\n    uglify({\n      mangle: {\n        toplevel: true,\n      },\n    }, minify),\n    espruino(),\n  ],\n  ...\n```\n\n## Espruino modules\n\nTo use [Espruino's modules](http://www.espruino.com/Modules), you have to first\ndownload them to your project's directory and import them as local files.\n\nHopefully this can be made as easy as in Espruino's Web IDE some day, where\nmodules are automatically downloaded when `require()`d in code.\n\n\n# License\n\nMIT © Joakim Stai\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoakim%2Frollup-plugin-espruino","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoakim%2Frollup-plugin-espruino","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoakim%2Frollup-plugin-espruino/lists"}