{"id":15046030,"url":"https://github.com/denosaurs/plug","last_synced_at":"2025-09-12T03:34:30.836Z","repository":{"id":38419235,"uuid":"280913486","full_name":"denosaurs/plug","owner":"denosaurs","description":"🔌 Deno FFI helper module","archived":false,"fork":false,"pushed_at":"2025-05-07T19:16:00.000Z","size":1953,"stargazers_count":89,"open_issues_count":6,"forks_count":12,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-11T19:22:03.669Z","etag":null,"topics":["cache","deno","deno-bindings","deno-ffi","deno-plugin","deno-plugins","ffi","hacktoberfest"],"latest_commit_sha":null,"homepage":"https://deno.land/x/plug","language":"TypeScript","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/denosaurs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"open_collective":"denosaurs","github":"denosaurs"}},"created_at":"2020-07-19T17:14:26.000Z","updated_at":"2025-08-25T16:53:39.000Z","dependencies_parsed_at":"2023-02-18T12:46:05.001Z","dependency_job_id":"8c768b5b-bd58-48a3-ac89-103511db4864","html_url":"https://github.com/denosaurs/plug","commit_stats":{"total_commits":88,"total_committers":11,"mean_commits":8.0,"dds":"0.43181818181818177","last_synced_commit":"8ff12de1fb4b19908d8b64e7652d999d9173e305"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/denosaurs/plug","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denosaurs%2Fplug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denosaurs%2Fplug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denosaurs%2Fplug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denosaurs%2Fplug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denosaurs","download_url":"https://codeload.github.com/denosaurs/plug/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denosaurs%2Fplug/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274748344,"owners_count":25341942,"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","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cache","deno","deno-bindings","deno-ffi","deno-plugin","deno-plugins","ffi","hacktoberfest"],"created_at":"2024-09-24T20:52:36.698Z","updated_at":"2025-09-12T03:34:30.820Z","avatar_url":"https://github.com/denosaurs.png","language":"TypeScript","funding_links":["https://opencollective.com/denosaurs","https://github.com/sponsors/denosaurs"],"categories":["TypeScript"],"sub_categories":[],"readme":"# plug\n\n[![Tags](https://img.shields.io/github/release/denosaurs/plug)](https://github.com/denosaurs/plug/releases)\n[![Checks](https://github.com/denosaurs/plug/actions/workflows/deno.yml/badge.svg)](https://github.com/denosaurs/plug/actions/workflows/deno.yml)\n[![Dependencies](https://github.com/denosaurs/plug/actions/workflows/depsbot.yml/badge.svg)](https://github.com/denosaurs/plug/actions/workflows/depsbot.yml)\n[![License](https://img.shields.io/github/license/denosaurs/plug)](https://github.com/denosaurs/plug/blob/master/LICENSE)\n\nPlug is a drop in extension for using remote dynamic libraries in deno. It\nautomatically handles caching and loading with minimal overhead. It can\nautomatically create the URL for your cross-operating-system, cross-architecture\nlibraries if you so wish using a simple configuration which deviates from the\nstandard URL/string path input.\n\n## Installation\n\nPlug is published to [jsr.io](https://jsr.io/@denosaurs/plug) and\n[deno.land](https://deno.land/x/plug). The recommended way to use it is to use\nJSR:\n\n```bash\ndeno add @denosaurs/plug\n```\n\nor without the CLI:\n\n```typescript\nimport * as plug from \"jsr:@denosaurs/plug\";\n```\n\n## Example using plug as an almost drop in replacement for `Deno.dlopen`\n\n```ts\nimport { dlopen } from \"@denosaurs/plug\";\n\n// Drop-in replacement for `Deno.dlopen` which fetches the following depending\n// on operating system:\n// * darwin: \"https://example.com/some/path/libexample.dylib\"\n// * windows: \"https://example.com/some/path/example.dll\"\n// * linux: \"https://example.com/some/path/libexample.so\"\nconst library = await dlopen(\"https://example.com/some/path/\", {\n  noop: { parameters: [], result: \"void\" },\n});\n\nlibrary.symbols.noop();\n```\n\n## Example using automatic binary name guessing\n\n```ts\nimport { dlopen, FetchOptions } from \"@denosaurs/plug\";\n\n// If you want plug to guess your binary names\nconst options: FetchOptions = {\n  name: \"example\",\n  url: \"https://example.com/some/path/\",\n  // Becomes:\n  // darwin: \"https://example.com/some/path/libexample.dylib\"\n  // windows: \"https://example.com/some/path/example.dll\"\n  // linux: \"https://example.com/some/path/libexample.so\"\n};\n\nconst library = await dlopen(options, {\n  noop: { parameters: [], result: \"void\" },\n});\n\nlibrary.symbols.noop();\n```\n\n## Example using nested cross-platform options\n\n```ts\nimport { dlopen, FetchOptions } from \"@denosaurs/plug\";\n\n// Also you can specify the path for certain architecture\nconst options: FetchOptions = {\n  name: \"example\",\n  url: {\n    darwin: {\n      aarch64: `https://example.com/some/path/libexample.aarch64.dylib`,\n      x86_64: `https://example.com/some/path/libexample.x86_64.dylib`,\n    },\n    windows: `https://example.com/some/path/example.dll`,\n    linux: `https://example.com/some/path/libexample.so`,\n    freebsd: \"https://example.com/some/path/libexample_freebsd.so\",\n    netbsd: \"https://example.com/some/path/libexample_netbsd.so\",\n    aix: \"https://example.com/some/path/libexample_aix.so\",\n    solaris: \"https://example.com/some/path/libexample_solaris.so\",\n    illumos: \"https://example.com/some/path/libexample_illumos.so\",\n  },\n};\n\nawait dlopen(options, {});\n```\n\n## Example using nested cross-platform options and automatic binary name guessing\n\n```ts\nimport { dlopen, FetchOptions } from \"@denosaurs/plug\";\n\n// Or even configure plug to automatically guess the binary names for you,\n// even when there are special rules for naming on specific architectures\nconst options: FetchOptions = {\n  name: \"test\",\n  url: \"https://example.com/some/path/\",\n  suffixes: {\n    darwin: {\n      aarch64: \".aarch64\",\n      x86_64: \".x86_64\",\n    },\n  },\n  // Becomes:\n  // darwin-aarch64: \"https://example.com/some/path/libexample.aarch64.dylib\"\n  // darwin-x86_64: \"https://example.com/some/path/libexample.x86_64.dylib\"\n};\n\nawait dlopen(options, {});\n```\n\n## Testing\n\nTo run the plug tests, you can use the following command:\n\n```bash\ndeno test --import-map test_import_map.json -A --doc\n```\n\nThe `test_import_map.json` file is used to map the `@denosaurs/plug` import to\nthe local `mod.ts` file instead of the remote one for the documentation tests.\n\n## Other\n\n### Related\n\n- [deno_plugin_prepare](https://github.com/manyuanrong/deno-plugin-prepare) - A\n  library for managing deno native plugin dependencies\n- [cache](https://github.com/denosaurs/cache) - Deno cache library\n\n### Contribution\n\nPull request, issues and feedback are very welcome. Code style is formatted with\n`deno fmt` and commit messages are done following Conventional Commits spec.\n\n### Licence\n\nCopyright 2020-2025, the denosaurs team. All rights reserved. MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenosaurs%2Fplug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenosaurs%2Fplug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenosaurs%2Fplug/lists"}