{"id":21540938,"url":"https://github.com/reshape/reshape-cli","last_synced_at":"2025-04-10T04:11:09.504Z","repository":{"id":57354549,"uuid":"78817517","full_name":"reshape/reshape-cli","owner":"reshape","description":"CLI for reshape","archived":false,"fork":false,"pushed_at":"2020-07-07T19:04:44.000Z","size":15,"stargazers_count":10,"open_issues_count":27,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T23:08:41.342Z","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/reshape.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-13T05:13:33.000Z","updated_at":"2025-02-06T04:52:20.000Z","dependencies_parsed_at":"2022-09-12T05:41:40.435Z","dependency_job_id":null,"html_url":"https://github.com/reshape/reshape-cli","commit_stats":null,"previous_names":["gitscrum/reshape-cli"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reshape%2Freshape-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reshape%2Freshape-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reshape%2Freshape-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reshape%2Freshape-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reshape","download_url":"https://codeload.github.com/reshape/reshape-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247801161,"owners_count":20998339,"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-24T05:00:34.680Z","updated_at":"2025-04-10T04:11:09.483Z","avatar_url":"https://github.com/reshape.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# reshape-cli\n\u003e Simple CLI for [reshape][reshape-url]\n\n[![node](https://img.shields.io/node/v/reshape-cli.svg?maxAge=2592000\u0026style=flat-square)]()[![NPM version][npm-image]][npm-url][![Travis Build Status](https://img.shields.io/travis/GitScrum/reshape-cli.svg?style=flat-square\u0026label=unix)](https://travis-ci.org/GitScrum/reshape-cli)[![AppVeyor Build Status][appveyor-img]][appveyor][![Coveralls Status][coveralls-image]][coveralls-url][![Dependency Status][depstat-image]][depstat-url][![Standard Code Style][style]][style-url]\n\n## Install\n\n```\nnpm install --global reshape-cli\n```\n\n## Usage\n\n```bash\n$ reshape --help\n\n  Usage\n  reshape [-o output-file/directory|-r] [-i input-file/directory] [--config|-c path/to/file/config] [--use|-u plugin]\n\n  Options\n  --config,  -c Path to JS file                    [string]\n  --output,  -o Output html file/folder result     [required]\n  --input,   -i Input html file/folder             [required]\n  --use,     -u reshape plugin name                [string]\n  --replace, -r Replace input file(s)              [boolean]\n  --help,    -h Show help                          [boolean]\n  --version, -v Show version number                [boolean]\n```\n\n## Config\n*Automatically loads plug-ins with configuration from package.json using [post-load-plugins](https://github.com/post-org/post-load-plugins)*\n\npackage.json\n```json\n{\n  \"name\": \"my project\",\n  \"dependencies\": {\n    \"reshape-include\": \"^1.0.2\"\n  },\n  \"reshape\": {\n    \"include\": {\n      \"root\": \"./\"\n    }\n  }\n}\n```\n\n## Sample example\n1. Create config in `package.json`\n\n  ```json\n  {\n    \"name\": \"my project\",\n    \"dependencies\": {\n      \"reshape-include\": \"^1.0.2\"\n    },\n    \"reshape\": {\n      \"include\": {\n        \"root\": \"./\"\n      }\n    }\n  }\n  ```\n\n2. Create `index.html`\n\n  ```html\n  \u003cp\u003eHere's my partial:\u003c/p\u003e\n  \u003cinclude src='_partial.html'\u003e\u003c/include\u003e\n  \u003cp\u003eafter the partial\u003c/p\u003e\n  ```\n\n3. Create `_partial.html`\n  ```html\n  \u003cstrong\u003ehello from the partial!\u003c/strong\u003e\n  ```\n\n4. Run the command in the terminal\n  ```bash\n  $ reshape -i path/to/input/index.html -o pat/to/output/result.html\n  ```\n  *Will be automatically found plugin `reshape-include` assembled configuration for it `{ \"root\": \"./\"}` and it will be initialized.*\n\n5. Enjoy `result.html`\n  ```html\n  \u003cp\u003eHere's my partial:\u003c/p\u003e\n  \u003cstrong\u003ehello from the partial!\u003c/strong\u003e\n  \u003cp\u003eafter the partial\u003c/p\u003e\n  ```\n\n## Options \n### `config`\nconfig.js  \n```js\nmodule.exports = {\n  parser: require('sugarml'),\n  plugins: {\n    include: {\n      root: './'\n    }\n  }\n};\n```\n```bash\n$ reshape -o output.html -i input.html -c config.js\n```\n\n--\n\n### `use`\n```bash\n$ reshape \n  -o output.html \n  -i input.html \n  -c config.js\n  -u reshape-custom-elements\n```\n\n--\n\n\n### `dir`\n```bash\n$ reshape -o outputFolder/ -i inputFolder/*.html\n```\n\n```bash\n$ reshape -o outputFolder/ -i inputFolder/**/*.html\n```\n\n--\n\n\n### `replace`\n```bash\n$ reshape -i input.html -r\n```\n\n```bash\n$ reshape -i inputFolder/*.html -r\n```\n\n### License [MIT](license)\n\n[reshape-url]: http://github.com/reshape/reshape\n\n[npm-url]: https://npmjs.org/package/reshape-cli\n[npm-image]: http://img.shields.io/npm/v/reshape-cli.svg?style=flat-square\n\n[travis-url]: https://travis-ci.org/GitScrum/reshape-cli\n[travis-image]: http://img.shields.io/travis/GitScrum/reshape-cli/master.svg?style=flat-square\u0026label=unix\n\n[appveyor]:     https://ci.appveyor.com/project/GitScrum/reshape-cli\n[appveyor-img]: https://img.shields.io/appveyor/ci/GitScrum/reshape-cli/master.svg?style=flat-square\u0026label=windows\n\n[coveralls-url]: https://coveralls.io/r/GitScrum/reshape-cli\n[coveralls-image]: http://img.shields.io/coveralls/GitScrum/reshape-cli.svg?style=flat-square\n\n[depstat-url]: https://david-dm.org/GitScrum/reshape-cli\n[depstat-image]: https://david-dm.org/GitScrum/reshape-cli.svg?style=flat-square\n\n[depstat-dev-url]: https://david-dm.org/GitScrum/reshape-cli\n[depstat-dev-image]: https://david-dm.org/GitScrum/reshape-cli/dev-status.svg?style=flat-square\n\n[style-url]: https://github.com/sindresorhus/xo\n[style]: https://img.shields.io/badge/code_style-XO-5ed9c7.svg?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freshape%2Freshape-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freshape%2Freshape-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freshape%2Freshape-cli/lists"}