{"id":19593266,"url":"https://github.com/mohammadshaad/create-own-npm-package","last_synced_at":"2026-06-25T02:31:41.702Z","repository":{"id":189152049,"uuid":"680145327","full_name":"mohammadshaad/create-own-npm-package","owner":"mohammadshaad","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-18T12:58:53.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-09T06:52:21.521Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mohammadshaad.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}},"created_at":"2023-08-18T12:58:24.000Z","updated_at":"2023-08-18T13:31:48.000Z","dependencies_parsed_at":"2023-08-18T14:25:44.044Z","dependency_job_id":null,"html_url":"https://github.com/mohammadshaad/create-own-npm-package","commit_stats":null,"previous_names":["mohammadshaad/create-own-npm-package"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadshaad%2Fcreate-own-npm-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadshaad%2Fcreate-own-npm-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadshaad%2Fcreate-own-npm-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadshaad%2Fcreate-own-npm-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohammadshaad","download_url":"https://codeload.github.com/mohammadshaad/create-own-npm-package/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240867430,"owners_count":19870405,"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-11-11T08:38:53.463Z","updated_at":"2026-06-25T02:31:41.647Z","avatar_url":"https://github.com/mohammadshaad.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Creating Your Own NPX Introduction Command\n\nCreating your own `npx` introduction command can be a fun and useful project! The `npx` command allows you to run Node.js-based packages without having to globally install them. Here's a step-by-step guide to creating your own `npx` introduction command:\n\n## Step 1: Choose a Package Name\n\nDecide on a unique name for your package. This name will be used to invoke your introduction command using `npx`.\n\n## Step 2: Create a New Directory\n\nCreate a new directory for your package. You can name it after the package name you chose in the previous step.\n\n```bash\nmkdir my-npx-intro\ncd my-npx-intro\n```\n\n## Step 3: Initialize Your Package\n\nInitialize your project as a Node.js package using the following command:\n\n```bash\nnpm init -y\n```\n\n## Create an Executable Script\n\nInside your project directory, create a JavaScript file that will serve as the executable script for your npx command. Let's call this file index.js. You can follow my example or edit it accordingly.\n\n### Make sure to define bin in 'package.json'\n\n```json\n\"bin\": {\n  \"my-npx-command\": \"./index.js\"\n},\n```\n\n## Make the Script Executable\n\nIn your terminal, make your script file executable by running:\n\n### For Linux\n\n```bash\nchmod +x index.js\n```\n\n### For Windows\n\n**Note:** git should be installed.\n\n```powershell\ngit update-index --chmod=+x index.js\n```\n\n## Test your command\n\n- Link the package using `npm link`\n- Test by running the command `npx package-name`\n- If it works as expected, make sure to unlink it using `npm unlink -g directory-name`\n\n## Publish your package\n\n- Make an [npm account](https://www.npmjs.com/)\n- Login to your account using the command `npm login`\n- Publish the package using the command `npm publish`\n\nSend it to your friends and find a cool way to introduce yourself!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohammadshaad%2Fcreate-own-npm-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohammadshaad%2Fcreate-own-npm-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohammadshaad%2Fcreate-own-npm-package/lists"}