{"id":20503847,"url":"https://github.com/phcode-dev/extension-node-template","last_synced_at":"2025-09-25T07:31:43.965Z","repository":{"id":238123137,"uuid":"795931018","full_name":"phcode-dev/extension-node-template","owner":"phcode-dev","description":"A Phoenix Code NodeJS Extension template","archived":false,"fork":false,"pushed_at":"2024-11-13T09:38:06.000Z","size":25,"stargazers_count":2,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T05:42:03.000Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/phcode-dev.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-04T12:33:51.000Z","updated_at":"2024-11-13T09:38:10.000Z","dependencies_parsed_at":"2024-05-04T13:37:48.597Z","dependency_job_id":"ce7b4384-d2e7-4d18-b702-4d12e31033d1","html_url":"https://github.com/phcode-dev/extension-node-template","commit_stats":null,"previous_names":["phcode-dev/extension-node-template"],"tags_count":3,"template":true,"template_full_name":"phcode-dev/extension-template","purl":"pkg:github/phcode-dev/extension-node-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phcode-dev%2Fextension-node-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phcode-dev%2Fextension-node-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phcode-dev%2Fextension-node-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phcode-dev%2Fextension-node-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phcode-dev","download_url":"https://codeload.github.com/phcode-dev/extension-node-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phcode-dev%2Fextension-node-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276881828,"owners_count":25721413,"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-25T02:00:09.612Z","response_time":80,"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":[],"created_at":"2024-11-15T19:34:37.900Z","updated_at":"2025-09-25T07:31:43.662Z","avatar_url":"https://github.com/phcode-dev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Extension Template\n\nQuick start and create a new `Phoenix Code node.js extension` by using this template. This template extension works in browser as well as desktop builds. In browser, it\nwill not use node, and node.js based functionalities are not available. Desktop\nbuilds will use node capabilities.\n\nIn desktop builds, there is an additional capability to execute node.js code.\nThis is helpful if you want to extend the functionality of Phoenix Code using\nthe vast npm library.\n\nFor creating extensions that do not need node, follow this link:\nhttps://github.com/phcode-dev/extension-template\n\n## Setting up node extensions\n\nIn package.json, add the following section\n\n```json\n{\n    \"nodeConfig\": {\n        \"nodeIsRequired\": false,\n        \"main\": \"node/index.js\",\n        \"npmInstall\": \"node/\"\n    }\n}\n```\n\n#### `nodeConfig` Object\n\nThe `nodeConfig` object indicates that this is a Node extension.\n\n#### `nodeIsRequired` Field\n\n-   Set this field to `true` if the extension relies on Node and won't function\n    without it.\n-   If set to `false` or omitted, the extension can still be loaded in browser\n    versions of Phoenix code without Node support, But will use node in native\n    builds.\n-   It will be shown in the extension manager dialog in browser builds as well.\n\n#### `main` Field\n\n-   Specifies the main entry point for the Node.js component of the extension.\n-   Should point to the main JavaScript file for the Node part of the extension.\n-   Example: `\"main\": \"node/index.js\"`\n\n#### `npmInstall` Field (Optional)\n\n-   Specifies the path to run `npm install` when the user installs the extension\n    from the extension manager.\n-   It's advisable not to package `node_modules` inside the extension. Only the\n    package lock file should be distributed.\n-   Example: `\"npmInstall\": \"node/\"`\n\n## Communicating between node.js and Phoenix Code\n\n### NodeConnector-API\n\ncreate [NodeConnector-API](https://docs.phcode.dev/api/API-Reference/NodeConnector) to call functions and send events between your node.js and Phoenix Code extension components.\n\n-   This is available as a global object `global.createNodeConnector`. See above\n    link for API docs.\n-   Another API -\n    [EventDispatcher-API](https://docs.phcode.dev/api/API-Reference/utils/EventDispatcher)\n    is also available in the global context as `global.EventDispatcher` for\n    event trigger/listen within node.\n\n# Using this template\n\nFollow the below 4 steps to start using this template:\n\nRefer this\n[link](https://docs.phcode.dev/api/creating-extensions) for detailed extension documentation after following the below steps:\n\n## step 1\n\nLogin with GitHub: https://github.com/login\n\n## step 2\n\nCreate a new repository using this template.\n![New extension from template](https://user-images.githubusercontent.com/5336369/223931565-2708e516-a422-4e7b-9d89-9ac48c919c3d.gif)\n\n## step 3\n\n-   Clone your GitHub Repo created from `step 2`. See\n    [this link](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)\n    to lean how to clone a repository from GitHub.\n-   Edit `package.json` file in template, make sure to update the following fields accordingly:\n\n| Field       | Description                                                            |\n|-------------|------------------------------------------------------------------------|\n| `title`     | Replace \"Name of the extension\" with the actual title of your extension. |\n| `name`      | Change `github-\u003cowner\u003e-\u003crepo\u003e` to your specific package name, formatted as `github-yourusername-reponame`. |\n| `description` | Update to a brief, relevant description of what your extension does.  |\n| `version`   | Start with \"0.0.1\" or update to reflect your current version following semantic versioning. |\n| `license`   | Confirm \"MIT\" is suitable or specify another license if necessary.     |\n| `author`    | Replace with your name and a link to your GitHub profile or another URL. |\n| `homepage`  | Set to the URL of your project’s homepage or GitHub repository.        |\n| `engines`   | Ensure compatibility with the required Brackets version, e.g., \"\u003e=3.0.0\". |\n| `categories`| Update \"demo\" with relevant categories that fit your extension.         |\n| `keywords`  | Update or append additional keywords that describe your extension.    |\n| `files`     | Ensure this includes all necessary files and folders for your extension. |\n\n\n\n## step 4\n\n-   Go to https://create.phcode.dev .This is a special development centric\n    website of phcode.dev which shows non minified js/css files in the browser\n    developer tools.\n-   Open the cloned folder and select `Debug \u003e Load Project As Extension`\n\n![image](https://user-images.githubusercontent.com/5336369/224746152-0416a862-891a-4fe1-b9dd-09add25a6cc0.png)\n\n-   You can now make code changes to your extension and select\n    `Debug\u003e Reload With Extensions` to test the new code changes.\n-   When you are done developing the extension/theme, select\n    `Debug\u003e Unload Project As Extension` to unload the extension.\n\n![image](https://user-images.githubusercontent.com/5336369/224747590-556dff1d-5b29-41c3-88a0-3ce72ab643d0.png)\n\n# Detailed Documentation\n\nPlease go to [https://docs.phcode.dev/api/creating-extensions](https://docs.phcode.dev/api/creating-extensionss) for more documentation/community support links.\n\n# Publishing your extension to the repository\n\nOnce you have built your extension/theme, you can publish the extension to\nphcode.dev extension repository in a single step directly from this repo. Please\nsee publish section in this link for more details: [Publishing extension and themes](https://docs.phcode.dev/api/publishing-extensions)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphcode-dev%2Fextension-node-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphcode-dev%2Fextension-node-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphcode-dev%2Fextension-node-template/lists"}