{"id":45388062,"url":"https://github.com/putoutjs/nirguna","last_synced_at":"2026-03-04T13:04:40.065Z","repository":{"id":337672872,"uuid":"1154714098","full_name":"putoutjs/nirguna","owner":"putoutjs","description":"Compile JavaScript to WASM and FASM","archived":false,"fork":false,"pushed_at":"2026-02-21T21:36:09.000Z","size":490,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-02-21T22:46:56.186Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/putoutjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"coderaiser","open_collective":"cloudcmd","ko_fi":"coderaiser"}},"created_at":"2026-02-10T17:40:52.000Z","updated_at":"2026-02-21T21:36:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/putoutjs/nirguna","commit_stats":null,"previous_names":["putoutjs/nirguna"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/putoutjs/nirguna","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/putoutjs%2Fnirguna","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/putoutjs%2Fnirguna/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/putoutjs%2Fnirguna/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/putoutjs%2Fnirguna/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/putoutjs","download_url":"https://codeload.github.com/putoutjs/nirguna/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/putoutjs%2Fnirguna/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29762291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T21:02:23.375Z","status":"ssl_error","status_checked_at":"2026-02-23T20:58:31.539Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":"2026-02-21T18:06:20.438Z","updated_at":"2026-03-04T13:04:40.053Z","avatar_url":"https://github.com/putoutjs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/coderaiser","https://opencollective.com/cloudcmd","https://ko-fi.com/coderaiser"],"categories":[],"sub_categories":[],"readme":"# Nirguna [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL] [![DeepScan][DeepScanIMGURL]][DeepScanURL]\n\n[NPMURL]: https://npmjs.org/package/nirguna \"npm\"\n[NPMIMGURL]: https://img.shields.io/npm/v/nirguna.svg?style=flat\u0026longCache=true\n[BuildStatusURL]: https://github.com/putoutjs/nirguna/actions?query=workflow%3A%22Node+CI%22 \"Build Status\"\n[BuildStatusIMGURL]: https://github.com/putoutjs/nirguna/workflows/Node%20CI/badge.svg\n[CoverageURL]: https://coveralls.io/github/putoutjs/nirguna?branch=master\n[CoverageIMGURL]: https://coveralls.io/repos/putoutjs/nirguna/badge.svg?branch=master\u0026service=github\n[DeepScanURL]: https://deepscan.io/dashboard#view=project\u0026tid=16903\u0026pid=20211\u0026bid=545558\n[DeepScanIMGURL]: https://deepscan.io/api/teams/16903/projects/20211/branches/545558/badge/grade.svg\n\n![nirguna](https://github.com/putoutjs/nirguna/blob/master/images/nirguna.jpg)\n\n\u003e Nirguna (Sanskrit: निर्गुण) refers to the supreme, ultimate reality (Brahman) in Hinduism and other Indian philosophies as being without form, material attributes, or limitations (derived from nir, meaning \"without,\" and guna, meaning \"quality\" or \"attribute\"). It signifies a transcendental, non-dual, and ineffable state of being.\n\nCompile JavaScript to WASM and Fasm.\n\n\u003cimg width=\"300\" alt=\"image\" src=\"https://github.com/user-attachments/assets/e3808fa0-90cc-4e9f-acb3-68babafa0350\" /\u003e\n\n## Install\n\n```\nnpm i nirguna -g\n```\n\n## Usage Example\n\nLet's suppose you have JavaScript:\n\n```js\nfunction add() {\n    const eax = 1;\n    const ebx = 2;\n    \n    return eax + ebx;\n}\n```\n\nYou can compile it to fasm and wasm.\n\n### Fasm\n\nLet's compile javascript with:\n\n```sh\nnirguna --target fasm example/fn.ts -o code\n```\n\nTo intermediate representation:\n\n```js\n__nirguna_add: {\n    mov(eax, 0x1);\n    mov(ebx, 0x2);\n    add(eax, ebx);\n    ret;\n}\n```\n\nAlso we can compile it with:\n\n```sh\nnirguna -t fasm example/fn.ts -o code\n```\n\nto assembly representation with:\n\n```asm\n__nirguna_add:\nmov eax, 0x1\nmov ebx, 0x2\nadd eax, ebx\nret\n```\n\nAlso we can compile it to binary representation with `nirguna fasm example/fn.ts`:\n\n```sh\n$ hexdump example/fn.bin\n\n0000000 b866 0001 0000 bb66 0002 0000 0166 c3d8\n0000010\n```\n\n### wasm\n\nLet's suppose we have absolutely valid JavaScript file with types, which we can run with node v24.\n\n```ts\nimport {create} from '#nirguna';\n\nexport const stack = [];\n\nexport const imports = [\n    ['console', 'log', function log() {\n        return i32;\n    }],\n];\n\nconst {\n    i32,\n    local,\n    call,\n} = create({\n    stack,\n    imports,\n});\n\nexport function x(a: i32, b: i32): i32 {\n    i32.add(local.get(a), local.get(b));\n    call('log');\n}\n```\n\nCompiled with `nirguna 1.wast.ts` to `1.wast`:\n\n```wast\n(module\n    (import \"console\" \"log\" (func $log (param $message i32) (result i32)))\n    (func $x (export \"x\") (param $a i32) (param $b i32) (result i32)\n        (i32.add (local.get $a) (local.get $b))\n        (call $log)\n    )\n)\n```\n\nWith:\n\n```js\nimport {compile} from 'nirguna';\n\nconst wast = compile(wastts);\nconst binary = await translate(wast);\n\nconst {x} = run(binary, {\n    console: {\n        log: (a) =\u003e {\n            console.log(a);\n            return a;\n        },\n    },\n});\n\nx(1, 2);\n// outputs\n3;\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fputoutjs%2Fnirguna","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fputoutjs%2Fnirguna","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fputoutjs%2Fnirguna/lists"}