{"id":13782532,"url":"https://github.com/cyntler/parcel-plugin-shebang","last_synced_at":"2025-04-28T17:40:36.949Z","repository":{"id":41888858,"uuid":"157537050","full_name":"cyntler/parcel-plugin-shebang","owner":"cyntler","description":"Plugin to generate shebang / hashbang for Parcel v1.x.x.","archived":false,"fork":false,"pushed_at":"2024-10-29T16:16:34.000Z","size":3035,"stargazers_count":16,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T22:02:47.027Z","etag":null,"topics":["hashbang","parcel-bundler","parcel-plugin","shebang"],"latest_commit_sha":null,"homepage":"https://parceljs.org","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/cyntler.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":"2018-11-14T11:13:34.000Z","updated_at":"2024-10-12T18:53:44.000Z","dependencies_parsed_at":"2023-02-08T20:01:24.867Z","dependency_job_id":"247cef5c-1c1f-4c6f-b5a5-12622987c91c","html_url":"https://github.com/cyntler/parcel-plugin-shebang","commit_stats":{"total_commits":64,"total_committers":4,"mean_commits":16.0,"dds":0.59375,"last_synced_commit":"2c7e4f305e4280d1b964f13f2cfa29cef8682275"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyntler%2Fparcel-plugin-shebang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyntler%2Fparcel-plugin-shebang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyntler%2Fparcel-plugin-shebang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyntler%2Fparcel-plugin-shebang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyntler","download_url":"https://codeload.github.com/cyntler/parcel-plugin-shebang/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251235401,"owners_count":21556942,"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":["hashbang","parcel-bundler","parcel-plugin","shebang"],"created_at":"2024-08-03T18:01:38.630Z","updated_at":"2025-04-28T17:40:36.908Z","avatar_url":"https://github.com/cyntler.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Other"],"readme":"[![npm-version](https://img.shields.io/npm/v/parcel-plugin-shebang.svg)](https://www.npmjs.com/package/parcel-plugin-shebang)\n[![npm-download](https://img.shields.io/npm/dt/parcel-plugin-shebang.svg)](https://www.npmjs.com/package/parcel-plugin-shebang)\n\n# parcel-plugin-shebang\n\u003e \\#!/usr/bin/env node\n\nDo you want your bundles generated by Parcel to have a **shebang** and it was easy to start from the console? This plugin allows this. You can build CLI applications in a simple way!\n\n## Installing\n\nTo install the plugin simply download the module.\u003cbr\u003e\nYou can use npm for this.\n\n```shell\nnpm i -D parcel-plugin-shebang\n```\n\n## Getting Started\n\nAfter successful installation, the plugin should work.\u003cbr\u003e\nIf you use this plugin without [configuration](#configuration) (which is described below) it will generate for you shebang automagically. However, the plugin only **works when** it finds a shebang line in source files that are `entry points` of Parcel.\n\n\u003e Without this plugin, if you place a shebang line in the source file, Parcel will leave it in code and treat it the same as normal JavaScript code. Unfortunately, after running this file you will get `SyntaxError`. This plugin is designed to move the shebang line to the very top of the file so that it does not cause any syntax problems.\n\nHere you can find a problem that tries to solve this plugin:\u003cbr\u003e\n\u003ca href=\"https://github.com/parcel-bundler/parcel/issues/2381\" target=\"_blank\"\u003ehttps://github.com/parcel-bundler/parcel/issues/2381\u003c/a\u003e\n\n## Configuration\n\nThe plugin has an **optional configuration** that allows you to generate shebang in bundle files. This is useful if you want your source files to not have a shebang.\n\nThere are two ways to configure the plugin:\n- You can use a dedicated configuration `.shebangrc` file. \n- Alternatively, you can save the configuration in the `package.json` file.\n\nThe configuration of the plugin is an array of objects describing the name of the interpreter and the array of files for which this interpreter is to be used.\n\n\u003e An array can contain many objects.\u003cbr\u003eIf the path to the file repeats in the next object, the interpreter from the first passed object containing the given file will be used.\n\n| Name          | Type     | Description                                                                  |\n| ------------- |----------| ---------------------------------------------------------------------------- |\n| `interpreter` | string   | Name of interpreter.                                 |\n| `files`       | string[] | Array of relative paths to the files in which the interpreter is to be used. |\n\n\u003cbr\u003e\n\n.shebangrc\n```json\n[\n  {\n    \"interpreter\": \"node\",\n    \"files\": [\n      \"./cli.ts\"\n    ]\n  }\n]\n```\n\npackage.json\n```json\n\"shebang\": [\n  {\n    \"interpreter\": \"node\",\n    \"files\": [\n      \"./cli.ts\"\n    ]\n  }\n]\n```\n\n**Now if you run the command:**\n\n```shell\nparcel build ./cli.ts\n```\n\nThe resulting file should contain a shebang with a `node` interpreter.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyntler%2Fparcel-plugin-shebang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyntler%2Fparcel-plugin-shebang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyntler%2Fparcel-plugin-shebang/lists"}