{"id":18812548,"url":"https://github.com/jsreport/jsreport-fs-store","last_synced_at":"2025-07-19T09:36:48.933Z","repository":{"id":57286274,"uuid":"44436039","full_name":"jsreport/jsreport-fs-store","owner":"jsreport","description":"jsreport template store extension","archived":false,"fork":false,"pushed_at":"2021-08-20T16:38:07.000Z","size":1530,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-22T14:03:49.428Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsreport.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-17T12:22:30.000Z","updated_at":"2021-08-20T16:38:11.000Z","dependencies_parsed_at":"2022-09-10T01:01:32.757Z","dependency_job_id":null,"html_url":"https://github.com/jsreport/jsreport-fs-store","commit_stats":null,"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"purl":"pkg:github/jsreport/jsreport-fs-store","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsreport%2Fjsreport-fs-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsreport%2Fjsreport-fs-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsreport%2Fjsreport-fs-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsreport%2Fjsreport-fs-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsreport","download_url":"https://codeload.github.com/jsreport/jsreport-fs-store/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsreport%2Fjsreport-fs-store/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265910177,"owners_count":23847518,"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-07T23:34:05.490Z","updated_at":"2025-07-19T09:36:48.908Z","avatar_url":"https://github.com/jsreport.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"**⚠️ This repository has been moved to the monorepo [jsreport/jsreport](https://github.com/jsreport/jsreport)**\n--\n\n# jsreport-fs-store\n[![NPM Version](http://img.shields.io/npm/v/jsreport-fs-store.svg?style=flat-square)](https://npmjs.com/package/jsreport-fs-store)\n[![Build Status](https://travis-ci.com/jsreport/jsreport-fs-store.png?branch=master)](https://travis-ci.com/jsreport/jsreport-fs-store)\n\n**[jsreport](https://github.com/jsreport/jsreport) template store extension. Supports editing templates in the external editors and browsers live reload and preview!**\n\nSee the docs https://jsreport.net/learn/fs-store\n\n## Installation\n\n\u003e npm install jsreport-fs-store\n\nThen alter jsreport configuration\n```js\n{\n\t'store': { 'provider': 'fs' }\n}\n```\n\n## Development\n(This section is intended to jsreport extension developers audience.)\n\n### Entity definitions\nUse `splitIntoDirectories` attribute in `registerEntitySet` to use the directory structure for storing. Otherwise the storage will put every entity row into the one single file.\n\n```js\nthis.documentStore.registerEntitySet(\"templates\", {entityType: \"jsreport.TemplateType\", splitIntoDirectories: true});\n```\n\nNot every jsreport entity should be spitted into the tree structure. It is especially not desired for the entities where you expect thousands of entries.  In this case just remove the `splitIntoDirectories` attribute.\n\nThe second required step is to extend the entity type with `publicKey` which is marking the attribute used for the row directory name. And also adding the `document` for the attributes you want to extract into dedicated files.\n\n```js\nvar templateAttributes = {\n\t...\n    shortid: {type: \"Edm.String\"},\n    name: {type: \"Edm.String\", publicKey: true},\n    content: {type: \"Edm.String\",\n\t    document: { extension: \"html\", engine: true }\n\t}\n    ...      \n};\n```\n\n### Engines\n\nEngines like handlebars or jade are able to override the default file extension for the template content files. This can be done using file extension resolver....\n\n```js\nreporter.documentStore.addFileExtensionResolver(function(doc, entitySetName, entityType, propertyType) {\n        if (doc.engine === \"handlebars\" \u0026\u0026 propertyType.document.engine) {\n            return \"handlebars\";\n        };\n    });\n```    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsreport%2Fjsreport-fs-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsreport%2Fjsreport-fs-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsreport%2Fjsreport-fs-store/lists"}