{"id":20383819,"url":"https://github.com/openwebf/node-wbc","last_synced_at":"2026-01-24T17:01:48.939Z","repository":{"id":219079802,"uuid":"671867039","full_name":"openwebf/node-wbc","owner":"openwebf","description":"WBC(WebF ByteCode Format) file implement for WebF.","archived":false,"fork":false,"pushed_at":"2025-01-20T14:21:30.000Z","size":7861,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-14T04:35:38.976Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openwebf.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,"zenodo":null}},"created_at":"2023-07-28T10:19:38.000Z","updated_at":"2025-01-20T14:21:31.000Z","dependencies_parsed_at":"2025-04-12T09:42:42.717Z","dependency_job_id":null,"html_url":"https://github.com/openwebf/node-wbc","commit_stats":null,"previous_names":["openwebf/node-qjsc"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/openwebf/node-wbc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwebf%2Fnode-wbc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwebf%2Fnode-wbc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwebf%2Fnode-wbc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwebf%2Fnode-wbc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openwebf","download_url":"https://codeload.github.com/openwebf/node-wbc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openwebf%2Fnode-wbc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28732216,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T10:24:43.181Z","status":"ssl_error","status_checked_at":"2026-01-24T10:24:36.112Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-15T02:24:35.832Z","updated_at":"2026-01-24T17:01:48.909Z","avatar_url":"https://github.com/openwebf.png","language":"C","readme":"# WBC\n\nThe [WBC](https://github.com/openwebf/rfc/blob/main/working/wbc1.en-US.md)(WebF bytecode file) file generator.\n\nThe WBC file is a specially designed binary file that contains pre-compiled JavaScript bytecodes and other assets, which could speed up the loading of WebF's application.\n\n## Install\n\n```\nnpm install @openwebf/wbc --save\n```\n\n## Cli Usage\n\n**Install**\n```\nnpm install @openwebf/wbc -g\n```\n\n**Convert JavaScript Into WBC file**\n\n```\nwbc -s /tmp/index.js -d /tmp\n```\n\n**Transform Inline Scripts in HTML**\n\n```\nwbc -s ./demo.html -d ./demo_wbc.html --convert-html\n```\n\n## Node Usage\n\n**Convert JavaScript Into WBC buffer**\n\n```javascript\nconst { compileJavaScriptToWbc } = require('@openwebf/wbc');\n\ncompileJavaScriptToWbc('function hello() { return 1 + 1};'); // \u003cBuffer ...\u003e the WBC bytes\n```\n\n**Transform Inline JavaScript Codes into WBC**\n\n```javascript\nconst { transformInlineScriptToWbc } = require('@openwebf/wbc');\n\nconst transformedHtml = transformInlineScriptToWbc(`\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003cbody\u003e\n    \u003cscript\u003e\n        console.log('helloworld');\n    \u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n`); \n\nconsole.log(transformedHtml); /*\n\u003chtml lang=\"en\"\u003e\n\u003cbody\u003e\n    \u003cscript\u003e\n    // The WBC binary contents\n    \u003c/script\u003e\n\n\u003c/body\u003e\u003c/html\u003e\n*/\n\n```\n\n## Contribute\n\n**Generate compile_commands.json**\n\n```\nnode-gyp configure -- -f gyp.generator.compile_commands_json.py\n```\n\n**Prebuild linux binary**\n\n1. Install docker\n2. Build local image with Dockerfile\n  ```\n  docker build -t qjsc .\n  ```\n3. Enter into images\n  ```\n  docker run --rm -it -v $(pwd):/project qjsc\n  ```\n4. Set up env in docker container\n  ```\n  cd project\n  scl enable rh-nodejs12 bash\n  scl enable devtoolset-7 bash\n  ```\n5. Build your binary\n  ```\n  npm install\n  npm run prebuild\n  ```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenwebf%2Fnode-wbc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenwebf%2Fnode-wbc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenwebf%2Fnode-wbc/lists"}