{"id":15402151,"url":"https://github.com/michareiser/llvm-node","last_synced_at":"2025-04-07T10:20:47.795Z","repository":{"id":18729530,"uuid":"83649282","full_name":"MichaReiser/llvm-node","owner":"MichaReiser","description":"LLVM 9.0+ Node Bindings","archived":false,"fork":false,"pushed_at":"2023-01-07T04:06:45.000Z","size":1058,"stargazers_count":182,"open_issues_count":21,"forks_count":27,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-14T19:32:43.446Z","etag":null,"topics":["llvm","llvm-node","node","v8"],"latest_commit_sha":null,"homepage":"","language":"C++","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/MichaReiser.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-02T07:40:50.000Z","updated_at":"2024-01-05T15:05:32.000Z","dependencies_parsed_at":"2023-01-13T19:58:52.965Z","dependency_job_id":null,"html_url":"https://github.com/MichaReiser/llvm-node","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaReiser%2Fllvm-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaReiser%2Fllvm-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaReiser%2Fllvm-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MichaReiser%2Fllvm-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MichaReiser","download_url":"https://codeload.github.com/MichaReiser/llvm-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247631833,"owners_count":20970069,"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":["llvm","llvm-node","node","v8"],"created_at":"2024-10-01T16:01:17.710Z","updated_at":"2025-04-07T10:20:47.760Z","avatar_url":"https://github.com/MichaReiser.png","language":"C++","readme":"# llvm-node\n\n[![Build Status](https://travis-ci.com/MichaReiser/llvm-node.svg?branch=master)](https://travis-ci.com/MichaReiser/llvm-node)\n[![npm version](https://badge.fury.io/js/llvm-node.svg)](https://badge.fury.io/js/llvm-node)\n\nNode Bindings for LLVM. The API is mostly identical to the one of LLVM (when possible and not to cumbersom). All supported methods with their signatures are listed in the [TypeScript definition file](./llvm-node.d.ts).\n\n## Getting Started\n\nInstall the packages using npm or yarn.\n\n```bash\nnpm install --save llvm-node\n```\n\nRequire llvm-node and you're good to go\n\n```js\nimport * as llvm from \"llvm-node\";\n// or\nconst llvm = require(\"llvm-node\");\n\nconst context = new llvm.LLVMContext();\nconst module = new llvm.Module(\"test\", context);\n\nconst intType = llvm.Type.getInt32Ty(context);\nconst initializer = llvm.ConstantInt.get(context, 0);\nconst globalVariable = new llvm.GlobalVariable(module, intType, true, llvm.LinkageTypes.InternalLinkage, initializer);\n\nconst ll = module.print(); // prints IR\nllvm.writeBitcodeToFile(module, biteCodeFileName); // Writes file to disk\n```\n\n## Custom LLVM Installation\n\nYou can use the npm configuration options to set the path to the LLVM cmake directory. This is needed if you don't want to use the system default LLVM installation --- e.g. when you want to compile againt the latest dev version.\n\nTo change the LLVM version use:\n\n```sh\nnpm config set cmake_LLVM_DIR $(path-to-llvm/bin/llvm-config --cmakedir)\n```\n\nIf you want to change the value just for a single project use an [.npmrc](https://docs.npmjs.com/files/npmrc) file in your project.\n\n## Debug Build\n\nIf you want to use `Value.dump` or `Module.dump` you need to use the debug build of the library (and, as well, of LLVM).\nIn this case, run `node-gyp build --debug` or if using `npm install` run `npm_config_DEBUG=true npm install llvm-node`.\n\nThere variables can also be set using npm set:\n\n`npm config set [--global] DEBUG True`\n\n## Develop with VS-Code\n\n1. Install the [C++ Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)\n2. Install the [Cmake Tools Extension](https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools)\n3. Configure the LLVM directory in the user settings by adding the following entry\n\n```json\n\"cmake.configureSettings\": {\n    \"LLVM_DIR\": \"/usr/local/Cellar/llvm/7.0.0/lib/cmake/llvm\" // Output of llvm-config --cmakedir\n}\n```\n\n4. Run the `CMake:Configure` Command in Visual Studio Code\n5. Run `yarn configure` from the command line\n6. Run `CMake:Build` command in Visual Studio Code\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichareiser%2Fllvm-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichareiser%2Fllvm-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichareiser%2Fllvm-node/lists"}