{"id":13486755,"url":"https://github.com/johnlindquist/kit-enigo","last_synced_at":"2025-03-19T21:31:15.766Z","repository":{"id":238338812,"uuid":"796351195","full_name":"johnlindquist/kit-enigo","owner":"johnlindquist","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-19T14:26:55.000Z","size":1278,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-17T15:21:23.222Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/johnlindquist.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":"2024-05-05T17:25:59.000Z","updated_at":"2024-06-18T05:11:32.000Z","dependencies_parsed_at":"2024-10-27T21:36:15.701Z","dependency_job_id":"c7f1c569-f1dc-4e77-949b-14c0361d3b6b","html_url":"https://github.com/johnlindquist/kit-enigo","commit_stats":null,"previous_names":["johnlindquist/kit-enigo"],"tags_count":8,"template":false,"template_full_name":"napi-rs/package-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnlindquist%2Fkit-enigo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnlindquist%2Fkit-enigo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnlindquist%2Fkit-enigo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnlindquist%2Fkit-enigo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnlindquist","download_url":"https://codeload.github.com/johnlindquist/kit-enigo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244507932,"owners_count":20463700,"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":[],"created_at":"2024-07-31T18:00:50.680Z","updated_at":"2025-03-19T21:31:15.275Z","avatar_url":"https://github.com/johnlindquist.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# `@johnlindquist/kit-enigo`\n\n![https://github.com/johnlindquist/kit-enigo/actions](https://github.com/johnlindquist/kit-enigo/workflows/CI/badge.svg)\n\n\u003e Template project for writing node packages with napi-rs.\n\n# Usage\n\n1. Click **Use this template**.\n2. **Clone** your project.\n3. Run `yarn install` to install dependencies.\n4. Run `npx napi rename -n [name]` command under the project folder to rename your package.\n\n## Install this test package\n\n```\nyarn add @johnlindquist/kit-enigo\n```\n\n## Support matrix\n\n### Operating Systems\n\n|                  | node14 | node16 | node18 |\n| ---------------- | ------ | ------ | ------ |\n| Windows x64      | ✓      | ✓      | ✓      |\n| Windows x32      | ✓      | ✓      | ✓      |\n| Windows arm64    | ✓      | ✓      | ✓      |\n| macOS x64        | ✓      | ✓      | ✓      |\n| macOS arm64      | ✓      | ✓      | ✓      |\n| Linux x64 gnu    | ✓      | ✓      | ✓      |\n| Linux x64 musl   | ✓      | ✓      | ✓      |\n| Linux arm gnu    | ✓      | ✓      | ✓      |\n| Linux arm64 gnu  | ✓      | ✓      | ✓      |\n| Linux arm64 musl | ✓      | ✓      | ✓      |\n| Android arm64    | ✓      | ✓      | ✓      |\n| Android armv7    | ✓      | ✓      | ✓      |\n| FreeBSD x64      | ✓      | ✓      | ✓      |\n\n## Ability\n\n### Build\n\nAfter `yarn build/npm run build` command, you can see `package-template.[darwin|win32|linux].node` file in project root. This is the native addon built from [lib.rs](./src/lib.rs).\n\n### Test\n\nWith [ava](https://github.com/avajs/ava), run `yarn test/npm run test` to testing native addon. You can also switch to another testing framework if you want.\n\n### CI\n\nWith GitHub Actions, each commit and pull request will be built and tested automatically in [`node@14`, `node@16`, `@node18`] x [`macOS`, `Linux`, `Windows`] matrix. You will never be afraid of the native addon broken in these platforms.\n\n### Release\n\nRelease native package is very difficult in old days. Native packages may ask developers who use it to install `build toolchain` like `gcc/llvm`, `node-gyp` or something more.\n\nWith `GitHub actions`, we can easily prebuild a `binary` for major platforms. And with `N-API`, we should never be afraid of **ABI Compatible**.\n\nThe other problem is how to deliver prebuild `binary` to users. Downloading it in `postinstall` script is a common way that most packages do it right now. The problem with this solution is it introduced many other packages to download binary that has not been used by `runtime codes`. The other problem is some users may not easily download the binary from `GitHub/CDN` if they are behind a private network (But in most cases, they have a private NPM mirror).\n\nIn this package, we choose a better way to solve this problem. We release different `npm packages` for different platforms. And add it to `optionalDependencies` before releasing the `Major` package to npm.\n\n`NPM` will choose which native package should download from `registry` automatically. You can see [npm](./npm) dir for details. And you can also run `yarn add @johnlindquist/kit-enigo` to see how it works.\n\n## Develop requirements\n\n- Install the latest `Rust`\n- Install `Node.js@10+` which fully supported `Node-API`\n- Install `yarn@1.x`\n\n## Test in local\n\n- yarn\n- yarn build\n- yarn test\n\nAnd you will see:\n\n```bash\n$ ava --verbose\n\n  ✔ sync function from native code\n  ✔ sleep function from native code (201ms)\n  ─\n\n  2 tests passed\n✨  Done in 1.12s.\n```\n\n## Release package\n\nEnsure you have set your **NPM_TOKEN** in the `GitHub` project setting.\n\nIn `Settings -\u003e Secrets`, add **NPM_TOKEN** into it.\n\nWhen you want to release the package:\n\n```\nnpm version [\u003cnewversion\u003e | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=\u003cprerelease-id\u003e] | from-git]\n\ngit push\n```\n\nGitHub actions will do the rest job for you.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnlindquist%2Fkit-enigo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnlindquist%2Fkit-enigo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnlindquist%2Fkit-enigo/lists"}