{"id":18685831,"url":"https://github.com/grapesjs/export","last_synced_at":"2025-04-06T10:12:50.282Z","repository":{"id":43800622,"uuid":"65240389","full_name":"GrapesJS/export","owner":"GrapesJS","description":"Export GrapesJS templates in a zip archive","archived":false,"fork":false,"pushed_at":"2023-09-17T21:45:01.000Z","size":1113,"stargazers_count":69,"open_issues_count":1,"forks_count":66,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-16T01:02:36.004Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GrapesJS.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}},"created_at":"2016-08-08T21:23:17.000Z","updated_at":"2024-05-01T02:12:01.000Z","dependencies_parsed_at":"2024-01-29T19:30:29.228Z","dependency_job_id":"84dd8cb8-5d1a-4b94-9b19-5495101fb480","html_url":"https://github.com/GrapesJS/export","commit_stats":{"total_commits":45,"total_committers":3,"mean_commits":15.0,"dds":0.0444444444444444,"last_synced_commit":"8d63d2e5f95b34d3b1dde49cf57432fe959edcff"},"previous_names":["artf/grapesjs-plugin-export"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrapesJS%2Fexport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrapesJS%2Fexport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrapesJS%2Fexport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrapesJS%2Fexport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GrapesJS","download_url":"https://codeload.github.com/GrapesJS/export/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247464222,"owners_count":20942970,"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-07T10:24:26.708Z","updated_at":"2025-04-06T10:12:50.253Z","avatar_url":"https://github.com/GrapesJS.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [GrapesJS Export](http://grapesjs.com)\n\nThis plugin adds the possibility to export template in a zip archive.\nDemo: http://grapesjs.com/demo.html\n\n\n\n## Summary\n\n* Plugin name: `grapesjs-plugin-export`\n* Commands: `gjs-export-zip`\n\n\n\n\n## Options\n\n|Option|Description|Default|\n|-|-|-\n| `addExportBtn` | Add a button inside the export dialog | `true` |\n| `btnLabel` | Label to the export button | `Export to ZIP` |\n| `filenamePfx` | ZIP filename prefix | `grapesjs_template` |\n| `filename` | Use a function to generate the filename, eg. `filename: editor =\u003e 'my-file.zip',` | `null` |\n| `root` | Use the root object to create the folder structure of your zip (async functions are supported), eg. `\n    {\n      css: {\n        'style.css': ed =\u003e ed.getCss(),\n        'some-file.txt': 'My custom content',\n      },\n      img: async ed =\u003e {\n        const images = await fetchImagesByStructue(ed.getComponents());\n        return images;\n        // Where `images` is an object like this:\n        // { 'img1.png': '...png content', 'img2.jpg': '...jpg content' }\n      },\n      'index.html': ed =\u003e `\u003cbody\u003e${ed.getHtml()}\u003c/body\u003e`\n    }\n  `\n  | `{ ...check the source }` |\n\n\n\n\n\n## Download\n\n* CDN\n  * `https://unpkg.com/grapesjs-plugin-export`\n* NPM\n  * `npm i grapesjs-plugin-export`\n* GIT\n  * `git clone https://github.com/GrapesJS/export.git`\n\n\n\n\n\n## Usage\n\nDirectly in the browser\n```html\n\u003clink href=\"https://unpkg.com/grapesjs/dist/css/grapes.min.css\" rel=\"stylesheet\"/\u003e\n\u003cscript src=\"https://unpkg.com/grapesjs\"\u003e\u003c/script\u003e\n\u003cscript src=\"path/to/grapesjs-plugin-export.min.js\"\u003e\u003c/script\u003e\n\n\u003cdiv id=\"gjs\"\u003e\u003c/div\u003e\n\n\u003cscript type=\"text/javascript\"\u003e\n  var editor = grapesjs.init({\n      container : '#gjs',\n      // ...\n      plugins: ['grapesjs-plugin-export'],\n      pluginsOpts: {\n        'grapesjs-plugin-export': { /* options */ }\n      }\n  });\n\n  // You can also call the command wherever you want in this way\n  editor.runCommand('gjs-export-zip');\n\u003c/script\u003e\n```\n\nModern javascript\n```js\nimport grapesjs from 'grapesjs';\nimport thePlugin from 'grapesjs-plugin-export';\n\nconst editor = grapesjs.init({\n  container : '#gjs',\n  // ...\n  plugins: [thePlugin],\n  pluginsOpts: {\n    [thePlugin]: { /* options */ }\n  }\n  // or\n  plugins: [\n    editor =\u003e thePlugin(editor, { /* options */ }),\n  ],\n});\n```\n\n\n\n\n\n## Development\n\nClone the repository\n\n```sh\n$ git clone https://github.com/GrapesJS/export.git.git\n$ cd grapesjs-plugin-export\n```\n\nInstall it\n\n```sh\n$ npm i\n```\n\nStart the dev server\n\n```sh\n$ npm start\n```\n\n\n\n## License\n\nBSD 3-Clause\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrapesjs%2Fexport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrapesjs%2Fexport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrapesjs%2Fexport/lists"}