{"id":16068172,"url":"https://github.com/milewski/generator-exporter","last_synced_at":"2025-03-18T05:31:12.175Z","repository":{"id":57247090,"uuid":"83882492","full_name":"milewski/generator-exporter","owner":"milewski","description":"Automate the 'Image Assets' menu, easy to integrate into any CI pipeline.","archived":false,"fork":false,"pushed_at":"2023-07-29T12:16:56.000Z","size":4271,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T17:24:11.066Z","etag":null,"topics":["assets","automation","ci","extract","generator","photoshop","pipeline"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/milewski.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":"2017-03-04T09:32:54.000Z","updated_at":"2023-08-05T09:46:45.000Z","dependencies_parsed_at":"2024-10-27T17:22:11.444Z","dependency_job_id":"555344fa-1981-44d2-a763-4dde3084c69e","html_url":"https://github.com/milewski/generator-exporter","commit_stats":{"total_commits":29,"total_committers":4,"mean_commits":7.25,"dds":0.3448275862068966,"last_synced_commit":"c966229f1e85355c6b381a7d8e29cfea7387991d"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milewski%2Fgenerator-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milewski%2Fgenerator-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milewski%2Fgenerator-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milewski%2Fgenerator-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/milewski","download_url":"https://codeload.github.com/milewski/generator-exporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244164878,"owners_count":20409004,"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":["assets","automation","ci","extract","generator","photoshop","pipeline"],"created_at":"2024-10-09T06:08:51.857Z","updated_at":"2025-03-18T05:31:08.115Z","avatar_url":"https://github.com/milewski.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Photoshop Assets Generator\n\n[![npm version](https://badge.fury.io/js/generator-exporter.svg)](https://badge.fury.io/js/generator-exporter)\n[![npm downloads](https://img.shields.io/npm/dm/generator-exporter.svg)](https://www.npmjs.com/package/generator-exporter)\n\nAutomate the extraction of photoshop assets using the **GENERATOR PLUGIN**,\n[here you can find a detailed explanation](https://github.com/adobe-photoshop/generator-assets/wiki/Generate-Web-Assets-Functional-Spec#getting-started) on how you should name your layers in order for this library to work.\n\nWhat this lib will do for you:\n\n- Automatically launch photoshop\n- Open a given array of files\n- Activate the Generator Assets Plugin\n- Close all documents after all assets has been generated, and optionally close photoshop.\n\nPerfect for CI (**Continuous Integration**) _This was the reason i built this anyway._\n\n## Why do i need this?\n\nIf you are developing something that grab some assets from a psd file, why not using the the magic of assets generation to streamline your pipeline? so then you don't have to export your assets every time you make some changes, and even better, if you are working with some kind of CI (Jenkins, Bamboo, [Strider](https://github.com/Strider-CD/strider)....) you can automate the assets extraction process!\n\n## Requirements\n\n**You must have photoshop installed in your local machine in order to this lib to work.**\n\nIn photoshop's preferences go to plug-ins and make sure **Enable Generator** and **Enable Remote Connections** are checked.\n\nPick any **Service Name** you like, and input a **Password** (this lib defaults to 123456).\n\n## Install\n\n```bash\nnpm install generator-exporter\n```\n\n#### Usage with Node\n\n```js\nimport { Generator } from 'generator-exporter'\nimport * as glob from 'glob'\nimport * as path from 'path'\n\nconst files = glob.sync(\n    path.resolve(__dirname, '**/*.psd')\n);\n\nconst generator = new Generator(files, {\n    password: '123456',\n    generatorOptions: {\n        'base-directory': path.resolve(__dirname, 'output')\n    }\n})\n\ngenerator.start().then(files =\u003e console.log(files));\n```\n#### Usage from Command Line\n\n```bash\ngenerator-cli --help \ngenerator-cli --files 'source/**/*.psd' --exclude '**/*(references|temp)/**' --password 654321 -c false -g.base-directory output\n```\n\n## Config Options (OptionsInterface)\n\n| Property         \t| Default   \t| Description                                                                                                              \t|\n|------------------\t|-----------\t|--------------------------------------------------------------------------------------------------------------------------\t|\n| closePhotoshop   \t| true      \t| Terminate photoshop after execution.                                                                                     \t|\n| hostname         \t| 127.0.0.1 \t| The host the socket is listing to connections, defaults to your local IP.                                                \t|\n| password         \t| 123456    \t| The generator's password set inside photoshop plugins section.                                                           \t|\n| port             \t| 49494     \t| Socket's port.                                                                                                           \t|\n| maxRetries       \t| 10        \t| Max number of retries this library will try to make with photoshop before assume it's dead.                              \t|\n| retryDelay       \t| 5000      \t| Delay between each retry.                                                                                                \t|\n| generatorOptions \t| { ... }   \t| [See all the available options in here.](https://github.com/adobe-photoshop/generator-assets/wiki/Configuration-Options) \t|\n\n## Api\n\n```js\n/** Create a Generator Instance  **/\nconst generator = new Generator(string|string[], OptionsInterface)\n\n/** Start Extraction **/\ngenerator.start().then(files =\u003e {})\n\n/** Self Explanatory **/\ngenerator.closePhotoshop()\ngenerator.closeActiveDocument()\ngenerator.closeAllDocuments()\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilewski%2Fgenerator-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmilewski%2Fgenerator-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilewski%2Fgenerator-exporter/lists"}