{"id":17648688,"url":"https://github.com/atishay/napi","last_synced_at":"2025-05-07T06:04:05.780Z","repository":{"id":150593248,"uuid":"157766758","full_name":"atishay/napi","owner":"atishay","description":"N-API based Souvenir service for CascadiaJS 2018","archived":false,"fork":false,"pushed_at":"2018-12-15T20:41:08.000Z","size":3246,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-07T06:04:00.787Z","etag":null,"topics":["cascadiajs","cplusplus","imagemagick","javascript","n-api","nan","nodejs","sample-code","tutorial"],"latest_commit_sha":null,"homepage":"https://n-api.herokuapp.com","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atishay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-11-15T20:11:21.000Z","updated_at":"2023-11-23T12:27:15.000Z","dependencies_parsed_at":"2023-04-06T11:53:28.185Z","dependency_job_id":null,"html_url":"https://github.com/atishay/napi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atishay%2Fnapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atishay%2Fnapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atishay%2Fnapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atishay%2Fnapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atishay","download_url":"https://codeload.github.com/atishay/napi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252823921,"owners_count":21809713,"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":["cascadiajs","cplusplus","imagemagick","javascript","n-api","nan","nodejs","sample-code","tutorial"],"created_at":"2024-10-23T11:19:49.192Z","updated_at":"2025-05-07T06:04:05.770Z","avatar_url":"https://github.com/atishay.png","language":"C++","readme":"N-API Tutorial\n===========================\n![Sample Output](test/edit.jpg)\n\n\u003e Do not use this on production. This is is meant to be a tutorial and not a production API. The code has been intentionally minimized to ignore many error cases and uses synchronous APIs for simplification.\n\nSample code which introduces the N-API stable in Node.js since Node 10+. The native code is present in the native folder. The rest of the code is present to demonstrate a sample application. This code was prepared for the Cascadia JS conference - https://2018.cascadiajs.com/.\n\nHere are the native pieces and the order in which they should be read:\n1) **Version** Gets the ImageMagick version as a string.\n2) **Info** Gets some basic information about the image from ImageMagick.\n3) **Edit** Edits an image via ImageMagick to create a new version used in the demo.\n\nThere are three versions of the sample usage app:\n\n1) **CLI** Wonderful for testing and debugging. Also used for the C++ debugger provided for VS Code.\n2) **Server** Express.js based web server hosting a sample app for the **Edit** application.\n3) **Electron** Sample Electron code using the **Edit** module.\n\nNo recompilation should be needed to run the electron and the node versions. Switching node versions should not need a recompilation to utilize the API. While the API is experimental in node 8 and should not be used in production, this code works for Node 8+ (with a warning in Node 8).\n\n## Important Scripts:\n* Recompile Native code\n```\nnode-gyp rebuild\n```\n* Run Electron Version\n```\nnpm run electron\n```\n* Run Web server\n```\nnpm start\n```\n* Run command line API tests\n```\nnpm test\n```\n\n## More resources on the N-API\n* Offical Documentation - https://nodejs.github.io/node-addon-api\n* Official Examples - https://github.com/nodejs/abi-stable-node-addon-examples.git (Must try)\n\n\nImage from: https://pixnio.com/transportation-vehicles/cars-automobile/wet-cold-mirror-dew-rain-car#\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatishay%2Fnapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatishay%2Fnapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatishay%2Fnapi/lists"}