{"id":19437682,"url":"https://github.com/mganss/pdjs","last_synced_at":"2026-02-08T09:32:42.925Z","repository":{"id":66297773,"uuid":"296895873","full_name":"mganss/pdjs","owner":"mganss","description":"JavaScript External for Pure Data based on V8","archived":false,"fork":false,"pushed_at":"2024-10-14T17:22:48.000Z","size":8420,"stargazers_count":72,"open_issues_count":2,"forks_count":3,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-06-02T18:12:56.826Z","etag":null,"topics":["javascript","js","pd","puredata","puredata-external","v8"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mganss.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-09-19T15:18:40.000Z","updated_at":"2025-03-04T18:21:22.000Z","dependencies_parsed_at":"2025-01-16T14:16:25.950Z","dependency_job_id":"08b89b86-9cac-414f-b108-779ab72617dd","html_url":"https://github.com/mganss/pdjs","commit_stats":{"total_commits":91,"total_committers":2,"mean_commits":45.5,"dds":0.4945054945054945,"last_synced_commit":"37774a5e6fa413ede3b04b7a03d71b5af4665283"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/mganss/pdjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mganss%2Fpdjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mganss%2Fpdjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mganss%2Fpdjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mganss%2Fpdjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mganss","download_url":"https://codeload.github.com/mganss/pdjs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mganss%2Fpdjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29226470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T09:15:18.648Z","status":"ssl_error","status_checked_at":"2026-02-08T09:14:33.745Z","response_time":57,"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":["javascript","js","pd","puredata","puredata-external","v8"],"created_at":"2024-11-10T15:15:36.577Z","updated_at":"2026-02-08T09:32:42.910Z","avatar_url":"https://github.com/mganss.png","language":"C++","readme":"#  pdjs\n\n[![GitHub Actions](https://github.com/mganss/pdjs/workflows/CI/badge.svg)](https://github.com/mganss/pdjs/workflows/CI/badge.svg)\n[![codecov](https://codecov.io/gh/mganss/pdjs/branch/master/graph/badge.svg?token=U4K4490WIM)](https://codecov.io/gh/mganss/pdjs/branch/master)\n\nA JavaScript external for Pure Data based on [V8](https://v8.dev/).\n\npdjs tries to emulate Max's [js](https://docs.cycling74.com/max8/refpages/js) object.\nMany JavaScript source files written for Max js should work unchanged with pdjs. \n\nWhile the Max js object uses a version of Mozilla's [SpiderMonkey](https://en.wikipedia.org/wiki/SpiderMonkey) JavaScript engine that was released in 2011 with Firefox 4.0 and thus\nlacks many newer language features (such as `let`), pdjs uses Google's V8 JavaScript engine which supports the latest ECMAScript standards and provides much better performance.\n\n### Supported platforms\n\n- Windows x64\n- Linux x64\n- Linux arm64\n- Linux arm\n- macOS x64\n\n## Usage\n\nYou can install through deken or grab a zip from [releases](https://github.com/mganss/pdjs/releases). Then create a `js` object giving it the name of a JavaScript file, e.g. `js src.js`, relative to your patch or absolute. You might also have to add a `declare -path pdjs` object so that PD can find the external. For more usage information you can consult the [Max JavaScript documentation](https://docs.cycling74.com/max8/vignettes/javascriptinmax) which applies to pdjs as well.\n\n## Feature support\n\n### General\n\nThere is no built-in editor like in Max, source files have to be created and edited outside of Pure Data.\n\n### [Arguments](https://docs.cycling74.com/max8/refpages/js#Arguments)\n\n- [x] `filename`\n- [ ] `inlets-outlets`\n- [x] `jsarguments`\n\n### [Messages](https://docs.cycling74.com/max8/refpages/js#Messages)\n\n- [x] `bang`\n- [ ] `int` (there are no ints in PD)\n- [x] `float`\n- [x] `list`\n- [x] `anything`\n- [ ] `autowatch`\n- [x] `compile`\n- [x] `delprop`\n- [ ] `editfontsize`\n- [x] `getprop`\n- [x] `loadbang`\n- [x] `open` (Windows only)\n- [x] `setprop`\n- [ ] `statemessage`\n- [ ] `wclose`\n\n### [Special function names](https://docs.cycling74.com/max8/vignettes/jsbasic#Special_Function_Names)\n\n- [ ] `msg_int`\n- [x] `msg_float`\n- [x] `list`\n- [x] `anything`\n- [x] `loadbang`\n- [ ] `getvalueof`\n- [ ] `setvalueof`\n- [ ] `save`\n- [ ] `notifydeleted`\n\nPrivate functions are supported.\n\n### [Global functions](https://docs.cycling74.com/max8/vignettes/jsglobal)\n\n- [x] `cpost`\n- [x] `error`\n- [x] `include`\n- [x] `messnamed`\n- [x] `post`\n- [x] `require`\n- [ ] `arrayfromargs` (use `Array.from(arguments)` or `[...arguments]` instead)\n- [ ] `assist`\n- [ ] `declareattribute`\n- [ ] `embedmessage`\n- [ ] `notifyclients`\n- [x] `outlet`\n- [ ] `setinletassist`\n- [ ] `setoutletassist`\n\n### Global properties\n\n- [ ] `autowatch`\n- [ ] `editfontsize`\n- [x] `inlet`\n- [x] `inlets`\n- [ ] `inspector`\n- [x] `jsarguments` (no support for `jsargs` message)\n- [ ] `Max`\n- [ ] `maxclass`\n- [x] `messagename`\n- [ ] `patcher`\n- [x] `outlets`\n\n### Other Objects\n\nThere is no support currently for other objects such as `Buffer`, `Dict`, `File`, etc.\n\n### Sharing JavaScript objects across `js` object instances\n\nYou can pass references to JavaScript objects across `js` object instances using the [`jsobject`](https://docs.cycling74.com/max8/vignettes/jsglobal#outlet) mechanism.\n\nThere is also a special global variable called `__global__` that references the same object from every `js` object instance. It's similar to the [`Global`](https://docs.cycling74.com/max8/vignettes/jsglobalobject) object in Max. Unlike in Max, you can also call functions contained in the `__global__` object.\n\n## Building\n\npdjs uses CMake to build. Prebuilt V8 binaries can be downloaded from [my V8 fork](https://github.com/mganss/v8/releases/latest) and [pd.build](https://github.com/pierreguillot/pd.build) is used to build the external library.\n\n### Prerequisites\n\n- Windows: Visual Studio 2019 (any edition, older versions may work, though not tested). You need to have the [Desktop development with C++](https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=vs-2019) workload installed. If you want to build the Linux external from VS you'll also need the workload [Linux development with C++](https://docs.microsoft.com/en-us/cpp/linux/download-install-and-setup-the-linux-development-workload?view=vs-2019). \n\n- Linux: \n  - g++\n  - cmake 3.13 or higher (if your distro has an older version, you can grab a static build from https://github.com/Microsoft/CMake/releases)\n  - ninja-build\n \n### V8 libraries\n\nThe build process expects the V8 library `v8_monolith` library in `v8/lib/[platform]`, e.g. `v8/lib/x64-linux`. You can either download prebuilt binaries from https://github.com/mganss/v8/releases/latest or build your own. This repo contains the GN configuration files that were used to build V8 in the [`v8`](https://github.com/mganss/pdjs/tree/master/v8) directory.\n\n### Building\n\nAlso check out the GitHub Actions [workflow definition](https://github.com/mganss/pdjs/blob/master/.github/workflows/main.yml) for more details on the build process.\n\n#### Windows\n\nOpen the top-level directory of the repo in VS and hit F6. The CMakeSettings.json contains 4 configurations: `x64-Debug` and `x64-Release` for Windows builds and `WSL-GCC-Debug` and `WSL-GCC-Release` for x64 Linux builds through WSL.\n\n#### Linux\n\n```sh\nmkdir -p out/build/x64-linux-Debug\ncmake -G Ninja \\\n  -DVERSION=1.0 \\\n  -DCMAKE_BUILD_TYPE=Debug \\\n  -B out/build/x64-linux-Debug -S .\ncmake --build out/build/x64-linux-Debug -- -v\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmganss%2Fpdjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmganss%2Fpdjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmganss%2Fpdjs/lists"}