{"id":16048257,"url":"https://github.com/prexview/prexview-js","last_synced_at":"2025-10-10T22:08:59.079Z","repository":{"id":49818946,"uuid":"77708314","full_name":"prexview/prexview-js","owner":"prexview","description":"Transform your data from XML or JSON to high quality, beautiful and readable documents in PDF, HTML, PNG or JPG","archived":false,"fork":false,"pushed_at":"2017-07-28T19:00:29.000Z","size":12,"stargazers_count":22,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-10T22:08:57.931Z","etag":null,"topics":["convert","converter","document-conversion","image","json","json-parser","json-to-html","json-to-pdf","json-to-png","prexview","tranform","xml","xml-parser","xml-to-html","xml-to-pdf","xml-to-png"],"latest_commit_sha":null,"homepage":"https://prexview.com","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/prexview.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}},"created_at":"2016-12-30T20:18:32.000Z","updated_at":"2024-08-12T08:47:07.000Z","dependencies_parsed_at":"2022-09-15T18:00:53.354Z","dependency_job_id":null,"html_url":"https://github.com/prexview/prexview-js","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/prexview/prexview-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prexview%2Fprexview-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prexview%2Fprexview-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prexview%2Fprexview-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prexview%2Fprexview-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prexview","download_url":"https://codeload.github.com/prexview/prexview-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prexview%2Fprexview-js/sbom","scorecard":{"id":744869,"data":{"date":"2025-08-11","repo":{"name":"github.com/prexview/prexview-js","commit":"32af9d3d3837fb6160393d9022a901339b20177b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/14 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-22T18:26:06.283Z","repository_id":49818946,"created_at":"2025-08-22T18:26:06.283Z","updated_at":"2025-08-22T18:26:06.283Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005457,"owners_count":26083898,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["convert","converter","document-conversion","image","json","json-parser","json-to-html","json-to-pdf","json-to-png","prexview","tranform","xml","xml-parser","xml-to-html","xml-to-pdf","xml-to-png"],"created_at":"2024-10-09T00:05:35.170Z","updated_at":"2025-10-10T22:08:59.063Z","avatar_url":"https://github.com/prexview.png","language":"JavaScript","readme":"# ![PrexView](https://prexview.com/media/extension/promo.png)\n\n[![Status](https://travis-ci.org/prexview/prexview-js.svg?branch=master)](https://travis-ci.org/prexview/prexview-js) [![npm version](https://badge.fury.io/js/prexview.svg)](https://npmjs.org/package/prexview \"View this project on npm\")\n\nA JavaScript module to use [PrexView][1], a fast, scalable and friendly service for programatic HTML, PDF, PNG or JPG generation using JSON or XML data.\n\n*See [PrexView][1] for more information about the service.*\n\n\n## Installation\n\n```\nnpm install --save prexview\n```\n\n## Getting started\n\n#### Get your API Key\n\nYou can get an API Key from [PrexView][1]\n\n#### Set up your API Key\n\nIf you can setup enviroment variables\n\n```\nexport PXV_API_KEY=\"YOUR_API_KEY\"\n```\n\nIf you can't setup environment variables, create the PrexView object with your API Key as argument\n\n```js\npxv = new PrexView('YOUR_API_KEY');\n```\n\n#### Include the library\n\n```js\nconst PrexView = require('prexview')\n```\n\n#### Sending an XML\n\nTo send an XML string use ```pxv.sendXML(xml, options)``` method, this method will return a [Promise][4] with the [Response object][3] on success or an error if something is wrong.\n\n##### Example\n\n```js\nconst fs = require('fs')\nconst PrexView = require('prexview')\n\nconst pxv = new Prexview();\n\nconst options = {\n  template: 'supported_languages',\n  output: 'pdf'\n}\n\nconst xml = `\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003clanguages\u003e\n  \u003clang code=\"en\"\u003eEnglish\u003c/lang\u003e\n  \u003clang code=\"es\"\u003eEspañol\u003c/lang\u003e\n  \u003clang code=\"fr\"\u003eFrançaise\u003c/lang\u003e\n\u003c/languages\u003e`;\n\nconst file = 'test.pdf'\n\npxv.sendXML(xml, options)\n  .then((res) =\u003e {\n    fs.writeFileSync(file, res.file)\n\n    console.log(`File created: ${file}`)\n  }).catch((err) =\u003e {\n    console.log(e.message)\n  })\n```\n\n#### Sending a JSON\n\nTo send a JSON string or JavaScript object use ```pxv.sendJSON(json, options)``` method, this method will return a [Promise][4] with the [Response object][3] on success or an error if something is wrong.\n\n##### Example\n\n```js\nconst fs = require('fs')\nconst PrexView = require('prexview')\n\nconst pxv = new Prexview();\n\nconst options = {\n  template: 'supported_languages',\n  output: 'pdf'\n}\n\n// this can also be a valid string.\nconst json = {\n  languages: [{\n    code: 'en',\n    name: 'Inglés'\n  }, {\n    code: 'es',\n    name: 'Spanish'\n  }, {\n    code: 'fr',\n    name: 'Française'\n  }]\n}\n\nconst file = 'test.pdf'\n\npxv.sendJSON(json, options)\n  .then((res) =\u003e {\n    fs.writeFileSync(file, res.file)\n\n    console.log(`File created: ${file}`)\n  }).catch((err) =\u003e {\n    console.log(e.message)\n  })\n```\n\n##### Response object\n\n|Property|Type|Description|\n|--------|:--:|-----------|\n|id|`string`|Transaction ID.|\n|file|`binary`|Document created by the service.|\n|responseTime|`int`|Response time from service.|\n|rateLimit|`int`|Maximum number of calls to the service.|\n|rateLimitReset|`int`|Seconds to reset the rate limit.|\n|rateRemaining|`int`|Number of remaining call to the service.|\n\n##### Options\n\n|Name|Type|Required|Description|\n|----|:--:|:------:|-----------|\n|template|`string`|Yes|Template's name to be used to document creation, you can use [dynamic values][2].|\n|output|`string`|Yes|Type of document that will be created by PrexView service, it must be **html**, **pdf**, **png** or **jpg**.|\n|note|`string`|No|Custom information to be added to the document's metadata, it's limit up to 500 characters and you can use [dynamic values][2].|\n|format|`string`|No|Type of data used to the document creation, it must be **xml** or **json**, this should be inferred from library methods.|\n|templateBackup|`string`|No|Template's name to use to be used if the option **template** is not available in the service.|\n\n##### Dynamic values\n\nIn **template** or **note** options you can use JSON sintax to access data and have dynamic values, for instance having the following JSON data:\n\n```json\n{\n  \"Data\": {\n    \"customer\": \"123\"\n  }\n}\n```\n\nYour **template** or **note** can use any data attribute or text node, for instance:\n\n```\n'invoice-customer-{{Data.customer}}'\n```\n\nThen we will translate that to the following:\n\n```\n'invoice-customer-123'\n```\n\nAnd finally the service will try to find the **template** or **note** ```invoice-customer-123``` in order to transform the data and generate the document.\n\n## License\n\nMIT © [PrexView][1]\n\n[1]: https://prexview.com\n[2]: #dynamic-values\n[3]: #response-object\n[4]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprexview%2Fprexview-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprexview%2Fprexview-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprexview%2Fprexview-js/lists"}