{"id":18787612,"url":"https://github.com/dimapaloskin/inpack","last_synced_at":"2025-04-13T13:12:33.927Z","repository":{"id":57274246,"uuid":"75938440","full_name":"dimapaloskin/inpack","owner":"dimapaloskin","description":"Nodejs invisible modules manager","archived":false,"fork":false,"pushed_at":"2017-01-14T13:08:12.000Z","size":100,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T04:12:32.480Z","etag":null,"topics":["ava","cli","dependencies-manager","javascript","js","modules","nodejs","xo"],"latest_commit_sha":null,"homepage":"","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/dimapaloskin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-08T13:05:45.000Z","updated_at":"2019-06-21T18:23:39.000Z","dependencies_parsed_at":"2022-08-26T13:30:17.714Z","dependency_job_id":null,"html_url":"https://github.com/dimapaloskin/inpack","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimapaloskin%2Finpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimapaloskin%2Finpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimapaloskin%2Finpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimapaloskin%2Finpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dimapaloskin","download_url":"https://codeload.github.com/dimapaloskin/inpack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717237,"owners_count":21150389,"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":["ava","cli","dependencies-manager","javascript","js","modules","nodejs","xo"],"created_at":"2024-11-07T20:55:14.277Z","updated_at":"2025-04-13T13:12:33.907Z","avatar_url":"https://github.com/dimapaloskin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Inpack [![npm version](https://badge.fury.io/js/inpack.svg)](https://www.npmjs.com/package/inpack) [![Build Status](https://travis-ci.org/dimapaloskin/inpack.svg?branch=master)](https://travis-ci.org/dimapaloskin/inpack) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)\n\nInpack is a cli tool that makes it possible to use any directory as a Node.js module. It helps in avoiding long relative paths (like ```import responseParser from '../../../utils/responseParser'```) in your \"require\" or \"import\" without creating any additional files apart from its own config file called inpack.json. Also provokes build more clean and clear project architecture. You can use inpack with [depy](https://github.com/dimapaloskin/depy).\n\n### Spoiler\n\nUse\n```js\nimport ComponentName from 'ComponentName';\n```\ninstead\n```js\nimport Component from './../../../components/dummy/ComponentName';\n```\n\n## Screencast\n\n[![asciicast](https://asciinema.org/a/eqwqbix1aw8vkn6fhb6zug5am.png)](https://asciinema.org/a/eqwqbix1aw8vkn6fhb6zug5am)\n\n## Installation\n\nInstall it globally:\n\n```bash\n$ npm install -g inpack\n```\n\n## Usage example\n\nSuppose we have a project with the following structure:\n```\n~/Project:\n  Components\n    MainComponent\n      index.js\n    WelcomeComponent\n      index.js\n  index.js\n  package.json\n ```\n \nUse next command in the project’s root directory (valid package.json is required):\n\n```bash\n~/Project $ inpack init\n```\nYou\nIt will create inpack.json.\n\nUse \"add\" to add existing directory as a Node.js module and save data to inpack.json:\n\n```bash\n~/Project $ inpack add Component/MainComponent\n```\n\nFrom now on, your ‘Component/MainComponent' directory can be added anywhere in the project in following ways:\n\n```js\nconst MainModule = require('MainModule');\n// or\nimport MainModule from 'MainModule';\n\n```\n\nIn future, if you need to deploy the project (or just clone it from github), you can simply run ‘link’. For example:\n\n```bash\n~/Project $ npm install\n~/Project $ inpack link\n```\n\nAll of your components are good to go now.\n\n## Commands list\n\n### `inpack init`\n\nCreates a new project in the current directory.\n\n**Available options:**\n- `--name` - project name (directory name by default)\n- `--prefix` - prefix for added modules. It makes sense using this option if you want to avoid conflicts with other modules. For example, suppose the project’s prefix is `@Project/`. Then, a module named `MainComponent` can be accessed via `@Project/MainComponent`. As a bonus, you always know that you are importing inpack module.\n- `--add-postinstall` - adds or modifies the `postinstall` attribute in the existing package.json by adding the `inpack link` command.\n\n### `inpack add [module/relative/path]`\n\nDeclares a directory as a Node.js module. Can be used in various ways:\n`inpack add \u003crelative-path\u003e` - adds specified directory as a module relative to the inpack master\n`inpack add` - adds current directory as a module.\n\n For example:\n ```bash\n ~/Project $ inpack add Components/MainComponent\n ```\n is equivalent to\n \n ```bash\n ~/Project/Components/MainComponent $ inpack add\n ```\n **Available options:**\n \n - `--name` - module name (directory name by default)\n - `--main` - main file, does the same as the \"main\" attribute from package.json does. `index.js` by default.\n - `--create` - creates a directory and main file, in case if either the directory or main file doesn’t exist.\n \n### `inpack remove [module name]`\n\nRemoves specified module (from the configuration as well). Does not remove the source-directory. Can be used in various ways as well as ‘add’.\n\n**Available options:**\n\n- `--force` - removes the module even if it’s not declared in the configuration file.\n \n### `inpack link`\n\nLinks all of the modules from inpack.json. Must be run from the master project.\n\n### `inpack info [module name]`\n\n**Alias:** resolve\n\nDisplays information about the module. Can be used in various ways as well as ‘add’ or ‘remove’.\n\n### `inpack list`\n\nLists a brief information about all modules.\n\n**Available options:**\n- `--verbose` - lists the full information about all modules.\n\n### Common options\n\nAlso there is the `—context-dir` option that is available for all of the commands and allows to specify a directory where you would like to run one or another command. For example:\n\n```bash\n~ $ inpack list \n✖ Searching for master project\nMaster project has not been found\n\n~ $ inpack list --context-dir ./Project\n[There goes the command output]\n```\n\n#### Author\n[Dmitry Pavlovsky](http://palosk.in)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimapaloskin%2Finpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimapaloskin%2Finpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimapaloskin%2Finpack/lists"}