{"id":13371913,"url":"https://github.com/microsoft/napajs","last_synced_at":"2025-09-27T00:31:17.028Z","repository":{"id":41113895,"uuid":"97646385","full_name":"microsoft/napajs","owner":"microsoft","description":"Napa.js: a multi-threaded JavaScript runtime","archived":true,"fork":false,"pushed_at":"2022-08-29T14:03:08.000Z","size":13039,"stargazers_count":9239,"open_issues_count":67,"forks_count":337,"subscribers_count":209,"default_branch":"master","last_synced_at":"2025-01-15T05:31:55.115Z","etag":null,"topics":["javascript","multi-core","multithreading","napajs","nodejs","parallel","runtime"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-18T21:41:10.000Z","updated_at":"2025-01-03T13:06:31.000Z","dependencies_parsed_at":"2022-07-13T10:50:30.212Z","dependency_job_id":null,"html_url":"https://github.com/microsoft/napajs","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fnapajs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fnapajs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fnapajs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fnapajs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/napajs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234324431,"owners_count":18814389,"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","multi-core","multithreading","napajs","nodejs","parallel","runtime"],"created_at":"2024-07-30T03:00:57.599Z","updated_at":"2025-09-27T00:31:15.842Z","avatar_url":"https://github.com/microsoft.png","language":"C++","readme":"[![Build Status for Linux/MacOS](https://travis-ci.org/Microsoft/napajs.svg?branch=master)](https://travis-ci.org/Microsoft/napajs)\n[![Build Status for Windows](https://ci.appveyor.com/api/projects/status/github/Microsoft/napajs?branch=master\u0026svg=true)](https://ci.appveyor.com/project/napajs/napajs)\n[![npm version](https://badge.fury.io/js/napajs.svg)](https://www.npmjs.com/package/napajs)\n[![Downloads](https://img.shields.io/npm/dm/napajs.svg)](https://www.npmjs.com/package/napajs)\n\n# Napa.js\nNapa.js is a multi-threaded JavaScript runtime built on [V8](https://github.com/v8/v8), which was originally designed to develop highly iterative services with non-compromised performance in Bing. As it evolves, we find it useful to complement [Node.js](https://nodejs.org) in CPU-bound tasks, with the capability of executing JavaScript in multiple V8 isolates and communicating between them. Napa.js is exposed as a Node.js module, while it can also be embedded in a host process without Node.js dependency.\n\n## Installation\nInstall the latest stable version:\n```\nnpm install napajs\n```\nOther options can be found in [Build Napa.js](https://github.com/Microsoft/napajs/wiki/build-napa.js).\n\n## Quick Start\n```js\nconst napa = require('napajs');\nconst zone1 = napa.zone.create('zone1', { workers: 4 });\n\n// Broadcast code to all 4 workers in 'zone1'.\nzone1.broadcast('console.log(\"hello world\");');\n\n// Execute an anonymous function in any worker thread in 'zone1'.\nzone1.execute(\n    (text) =\u003e text, \n    ['hello napa'])\n    .then((result) =\u003e {\n        console.log(result.value);\n    });\n```\nMore examples:\n* [Estimate PI in parallel](./examples/tutorial/estimate-pi-in-parallel)\n* [Max sub-matrix of 1s with layered parallelism](./examples/tutorial/max-square-sub-matrix)\n* [Parallel Quick Sort](./examples/tutorial/parallel-quick-sort)\n* [Recursive Fibonacci with multiple JavaScript threads](./examples/tutorial/recursive-fibonacci)\n* [Synchronized loading](./examples/tutorial/synchronized-loading)\n\n## Features\n- Multi-threaded JavaScript runtime.\n- Node.js compatible module architecture with NPM support.\n- API for object transportation, object sharing and synchronization across JavaScript threads.\n- API for pluggable logging, metric and memory allocator.\n- Distributed as a Node.js module, as well as supporting embed scenarios.\n\n## Documentation\n- [Napa.js Home](https://github.com/Microsoft/napajs/wiki)\n- [API Reference](./docs/api/index.md)\n- [FAQ](https://github.com/Microsoft/napajs/wiki/FAQ)\n\n# Contribute\nYou can contribute to Napa.js in following ways:\n\n* [Report issues](https://github.com/Microsoft/napajs/issues) and help us verify fixes as they are checked in.\n* Review the [source code changes](https://github.com/Microsoft/napajs/pulls).\n* Contribute to core module compatibility with Node.\n* Contribute bug fixes.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\u003cbr\u003e For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact opencode@microsoft.com with any additional questions or comments.\n\n# License\nCopyright (c) Microsoft Corporation. All rights reserved.\n\nLicensed under the [MIT](https://github.com/Microsoft/napajs/blob/master/LICENSE.txt) License.\n","funding_links":[],"categories":["C++","\u003ca name=\"cpp\"\u003e\u003c/a\u003eC++","Runtimes","Awesome-Packages","Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fnapajs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2Fnapajs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fnapajs/lists"}