{"id":18674081,"url":"https://github.com/nervosnetwork/moleculec-es","last_synced_at":"2025-04-12T01:55:14.964Z","repository":{"id":42573180,"uuid":"246448662","full_name":"nervosnetwork/moleculec-es","owner":"nervosnetwork","description":"ECMAScript plugin for the molecule serialization system","archived":false,"fork":false,"pushed_at":"2024-06-03T06:34:23.000Z","size":37,"stargazers_count":8,"open_issues_count":0,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T01:55:07.956Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/nervosnetwork.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":"2020-03-11T01:44:31.000Z","updated_at":"2024-06-07T02:46:38.000Z","dependencies_parsed_at":"2024-06-21T16:35:27.746Z","dependency_job_id":null,"html_url":"https://github.com/nervosnetwork/moleculec-es","commit_stats":null,"previous_names":["xxuejie/moleculec-es"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Fmoleculec-es","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Fmoleculec-es/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Fmoleculec-es/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nervosnetwork%2Fmoleculec-es/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nervosnetwork","download_url":"https://codeload.github.com/nervosnetwork/moleculec-es/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505869,"owners_count":21115354,"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-07T09:17:27.774Z","updated_at":"2025-04-12T01:55:14.945Z","avatar_url":"https://github.com/nervosnetwork.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# moleculec-es\nECMAScript plugin for the molecule serialization system\n\n# Usage\n\nFirst, download precompiled binary from [releases](https://github.com/xxuejie/moleculec-es/releases) page, and put the binary in our PATH. You could also clone and build the project from source. The only dependency is Golang here.\n\n```\n$ cargo install moleculec\n$ moleculec --language - --schema-file \"your schema file\" --format json \u003e /tmp/schema.json\n$ moleculec-es -inputFile /tmp/schema.json -outputFile \"your JS file\"\n```\n\nGenerated file from this project follows latest ECMAScript standard, it is also orgnaized as an ECMAScript module to allow for tree shaking.\n\n## Options\n\n```\nUsage of moleculec-es:\n  -generateTypeScriptDefinition\n        True to generate TypeScript definition\n  -hasBigInt\n        True to generate BigInt related functions\n  -inputFile string\n        Input file to use\n  -outputFile string\n        Output file to generate, use '-' to print to stdout (default \"-\")\n```\n\n## ESM to CommonJS\n\nSince moleculec-es generates ECMAScript modules, if you are using TS (\u003c 4.5) or NodeJS(without ESM support) then you can convert ESM to CommonJS first. For example\n\n```\nnpm i @babel/core @babel/cli @babel/plugin-transform-modules-commonjs\n./node_modules/.bin/babel --plugins @babel/plugin-transform-modules-commonjs generated.js\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnervosnetwork%2Fmoleculec-es","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnervosnetwork%2Fmoleculec-es","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnervosnetwork%2Fmoleculec-es/lists"}