{"id":13631880,"url":"https://github.com/bluwy/fmu","last_synced_at":"2025-04-15T16:35:08.642Z","repository":{"id":46754857,"uuid":"514003209","full_name":"bluwy/fmu","owner":"bluwy","description":"A collection of JS module utilities written in Rust","archived":false,"fork":false,"pushed_at":"2024-09-28T04:40:48.000Z","size":113,"stargazers_count":22,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T22:23:43.689Z","etag":null,"topics":["javascript","module"],"latest_commit_sha":null,"homepage":"https://bluwy.github.io/fmu","language":"Rust","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/bluwy.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},"funding":{"github":"bluwy"}},"created_at":"2022-07-14T18:11:16.000Z","updated_at":"2024-11-04T16:18:35.000Z","dependencies_parsed_at":"2024-01-22T01:09:20.923Z","dependency_job_id":"5dd7d653-e5e3-44fd-8870-29636459db2d","html_url":"https://github.com/bluwy/fmu","commit_stats":{"total_commits":53,"total_committers":2,"mean_commits":26.5,"dds":"0.018867924528301883","last_synced_commit":"8683364bf9d86754335ae0e2767d91060e668d1a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluwy%2Ffmu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluwy%2Ffmu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluwy%2Ffmu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bluwy%2Ffmu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bluwy","download_url":"https://codeload.github.com/bluwy/fmu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710435,"owners_count":21149189,"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":["javascript","module"],"created_at":"2024-08-01T22:02:42.231Z","updated_at":"2025-04-15T16:35:08.621Z","avatar_url":"https://github.com/bluwy.png","language":"Rust","funding_links":["https://github.com/sponsors/bluwy"],"categories":["Rust"],"sub_categories":[],"readme":"\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://user-images.githubusercontent.com/34116392/179419080-7ef828f6-6f83-429c-ae4b-3d8e40976c4d.svg\" height=\"140\"\u003e\n    \u003cimg src=\"https://user-images.githubusercontent.com/34116392/179418976-8154b41b-087a-4a5a-9254-639707e48a4e.svg\" height=\"140\"\u003e\n  \u003c/picture\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  A collection of JS module utilities written in Rust\n\u003c/p\u003e\n\n## Usage\n\nThe package is published to npm as a WebAssembly module. Install with:\n\n```bash\n$ npm install fmu\n```\n\n```js\nimport { init, guessJsSyntax } from 'fmu'\n\n// initialize wasm (MUST call this before any other APIs)\nawait init()\n\nconst code = `exports.foo = 'bar'`\nconsole.log(await guessJsSyntax(code)) // \"CJS\"\n```\n\n\u003e **Note**: For Vite, you have to pass a custom URL to `init()`. For example:\n\u003e\n\u003e ```js\n\u003e import { init } from 'fmu'\n\u003e import wasmUrl from 'fmu/wasm?url'\n\u003e await init(wasmUrl)\n\u003e ```\n\nSee [examples](./examples/) for usage with different setups.\n\n## Development\n\nFollow the [official guide](https://www.rust-lang.org/tools/install) to install Rust. Also install [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/) to build Rust files into WebAssembly.\n\n```bash\n# Build wasm for dev (e.g. testing examples)\n$ npm run dev\n\n# Build wasm for publishing\n$ npm run build\n\n# Run unit and integration tests\n$ cargo test\n```\n\n## Sponsors\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://bjornlu.com/sponsor\"\u003e\n    \u003cimg src=\"https://bjornlu.com/sponsors.svg\" alt=\"Sponsors\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluwy%2Ffmu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbluwy%2Ffmu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbluwy%2Ffmu/lists"}