{"_id":"@darvesh/portray","_rev":"5-aebb1f8c06c720d8417a331f3d28e1db","time":{"1.0.0":"2020-11-02T18:06:49.928Z","created":"2020-11-02T18:09:00.534Z","0.5.0":"2020-11-02T18:09:00.757Z","modified":"2022-04-05T02:46:12.500Z","0.5.3":"2020-11-02T21:53:07.208Z","0.5.4":"2020-11-02T22:05:17.149Z"},"name":"@darvesh/portray","dist-tags":{"latest":"0.5.4"},"versions":{"0.5.0":{"name":"@darvesh/portray","version":"0.5.0","description":"Generate beautiful image from your source code","main":"index.js","scripts":{"test":"mocha -t 1500 --reporter spec --require ts-node/register 'src/test/**/*.test.ts'","build":"tsc && copyfiles -f ./src/resources/**/* ./build/resources","pre-publish":"npm run build && copyfiles package.json package-lock.json README.md build"},"author":{"name":"Darvesh"},"license":"MIT","dependencies":{"highlight.js":"^10.3.1"},"devDependencies":{"@types/chai":"^4.2.14","@types/chai-as-promised":"^7.1.3","@types/mocha":"^8.0.3","@types/node":"^14.14.2","@typescript-eslint/eslint-plugin":"^4.5.0","@typescript-eslint/parser":"^4.5.0","chai":"^4.2.0","chai-as-promised":"^7.1.1","copyfiles":"^2.4.0","eslint":"^7.12.0","eslint-config-prettier":"^6.14.0","eslint-plugin-prettier":"^3.1.4","mocha":"^8.2.0","prettier":"^2.1.2","ts-node":"^9.0.0","typescript":"^4.0.3"},"prettier":{"tabWidth":4,"useTabs":true,"singleQuote":false,"trailingComma":"none","arrowParens":"avoid","printWidth":80},"repository":{"type":"git","url":"git+https://github.com/darvesh/portray.git"},"bugs":{"url":"https://github.com/darvesh/portray/issues"},"homepage":"https://github.com/darvesh/portray#readme","_id":"@darvesh/portray@0.5.0","_nodeVersion":"15.0.1","_npmVersion":"7.0.3","dist":{"integrity":"sha512-lx31+Lvj62s66A2bfiY7DmdJV1AZY3rsfrdVYQA829IngrxJlDomBt4K6Hfh1KbMWK3S/dFdsiVXfg5kCLCCcw==","shasum":"a33616f606c1ed9e3412dffdeb3da30db2e7a1bd","tarball":"https://registry.npmjs.org/@darvesh/portray/-/portray-0.5.0.tgz","fileCount":20,"unpackedSize":382816,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoEs9CRA9TVsSAnZWagAAE5EP/R4QHzLqqhUrdZjCHoYX\nKZwdU68sNFEv4lF1aodVLlToBAalsD/ZfdAWWx8ATShR7asxf79SylxSvPH2\nK92TjA0g7/vlEneE3gd26TWy4F7kfyBD6FFx47+bToybUJZGj3RAVniqixlE\njKx4Ox9s+7TJGaUjE7i/3fpHYKMbInP+nC2nIYY7OEB4/2/kWhrdrB8tPA2A\nNv3bEgukh3gMzO8PWg0sanRPjDfypGxFIfglaKEDHt32sVZ6zTrKdKUlLCYK\nsX5cD1rB34EQ7S9pt0fRqdg7S9pQ5yuU4UNRE4UR/5E9buOrzTCsiU0HbGzo\nntsDXinzPcwbBNx0NpWoO19+UyreqCnnUf6sdESyoQwaZKYB2HZkIiCl/lBe\nvZwm/9xs59+4q9S2Vh9GZy1AM+DZNSG0H0AIBLWALuCJf0b96E5yFPE6JSTE\nZXk/U6qRxBLMK+5WzBAM4+bj+xBN8PyHLd/2tNM8c6kWaqp6sFEW1qkIp6G6\nQwyZB9/XTeRvCx1bMW2pj9qsAmwe6TQvNPH3WVRmx0SOPdR8z+jpZdNbaFdu\nyZ8LoT5ax5HSeX7t6LJC6OjuIPbqn0NLz8FxK/z5zebzGI6QoaL1oM0+2m4Y\n8z223amn31fjS75qGEvaAJGK5YQG1SWmoWM0sVKP0bBklUsjiWKp31O7toa+\n1Jql\r\n=UrEa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHhCCIjLfc+W06RdfWtLJoLy2v6WZH+Qmwv5I4klar5LAiEA1ggHACr7lzwKauYPwrw/BsYhMv30I5z2V3FnP5hM+/A="}]},"maintainers":[{"name":"darvesh","email":"drvsh@protonmail.com"}],"_npmUser":{"name":"darvesh","email":"drvsh@protonmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/portray_0.5.0_1604340540591_0.8433040675893568"},"_hasShrinkwrap":false},"0.5.3":{"name":"@darvesh/portray","version":"0.5.3","description":"Generate beautiful image from your source code","main":"build/index.js","scripts":{"test":"mocha -t 2000 --reporter spec --require ts-node/register 'test/**/*.test.ts'","build":"tsc","prepublish":"npm run build && npm publish --access-public"},"author":{"name":"Darvesh"},"license":"MIT","dependencies":{"highlight.js":"^10.3.1"},"devDependencies":{"@types/chai":"^4.2.14","@types/chai-as-promised":"^7.1.3","@types/mocha":"^8.0.3","@types/node":"^14.14.2","@typescript-eslint/eslint-plugin":"^4.5.0","@typescript-eslint/parser":"^4.5.0","chai":"^4.2.0","chai-as-promised":"^7.1.1","eslint":"^7.12.0","eslint-config-prettier":"^6.14.0","eslint-plugin-prettier":"^3.1.4","mocha":"^8.2.0","prettier":"^2.1.2","ts-node":"^9.0.0","typescript":"^4.0.3"},"prettier":{"tabWidth":4,"useTabs":true,"singleQuote":false,"trailingComma":"none","arrowParens":"avoid","printWidth":80},"repository":{"type":"git","url":"git+https://github.com/darvesh/portray.git"},"bugs":{"url":"https://github.com/darvesh/portray/issues"},"homepage":"https://github.com/darvesh/portray#readme","gitHead":"aed455a616698b8693b002a7528d0d176643e7d4","_id":"@darvesh/portray@0.5.3","_nodeVersion":"15.0.1","_npmVersion":"7.0.3","dist":{"integrity":"sha512-CQNz+1xOOiulvmIw68GhbUGEsG1P5mCGbOfMYYAyl+yMnbDNQKm4/Pv+IRcSHlxqPfiI3YBRLf9xYwdcRQflKg==","shasum":"846c87388c991474128eb574e0347c7900849ab2","tarball":"https://registry.npmjs.org/@darvesh/portray/-/portray-0.5.3.tgz","fileCount":21,"unpackedSize":383947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoH/DCRA9TVsSAnZWagAAqIwQAKL88D+XXzIxXqqKjAw6\nk/TGI6sTIHdvtzdKw3PPN+SjtqtFWcvztHK6Cge1btT4ThxcPmYKP1vjnbhd\nurQ6P/4w9mJn5iMa1EAIWgrchUogFhp3SrBvh/XNO4Uxg+c5+06pFjsHpSAC\nUNTGm2gmRaSLSvfbns0fjp0lyWV2OpN4qLSKWkjlOSZn37DWJUJRupkJ5Hyi\ndYJJA2jO0STPR1vffDQWNMlc7JMgvmFWA7p1wqBJEzs6FjvzwyJMzw95HlZl\nzwsX4kZvRhDhv+5uX0zsYjemq2pIqn4NoC1wtwuPs0I+y77hU/wj9G5BFQEP\nQhB6IJ7MsP8GeM1gmUa2siqcFkDs0GYv+N4IaeRuqvJRvakicCEYfYKyXICC\nzncke9s2IaL2nFj9Zifx81yk8fjsZSI6bdLDLeIjYUwESoHSEhkY8M15bVdo\nNb+20g3IAy/eDi1ZHKM3h5WKTZpd9Z2mM4KFKhIbB+n9XSlKE9DpmrxH2S6i\nlneyQAAHqMEeRMmBhdyTG6ACF4CHvzDXmWqcjSOgy4bwA+AreOGCM/xwOY24\n/7BADeJ9mZyfJN0Ft/2z7uPsRIHCvw/Bm3Qio+fmPu6LHMFBI2mdXhWE+2L9\nO8VlKuklnESQ6DofPbysha8CcTJMc44oNUZLmvhS5KcQbFBEvQIWreem0Y4A\nibWV\r\n=OslG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFEX15JceWKetTuS1URqJYm/6D/bDZH1IomarwSRfseVAiEAkaUH6wm/IC5jvrUICTRW8z+y8WV6edpdIKMyrXi696Y="}]},"maintainers":[{"name":"darvesh","email":"drvsh@protonmail.com"}],"_npmUser":{"name":"darvesh","email":"drvsh@protonmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/portray_0.5.3_1604353987042_0.023896455488171986"},"_hasShrinkwrap":false},"0.5.4":{"name":"@darvesh/portray","version":"0.5.4","description":"Generate beautiful image from your source code","main":"build/index.js","scripts":{"test":"mocha -t 2000 --reporter spec --require ts-node/register 'test/**/*.test.ts'","build":"tsc","prepublish":"npm run build && npm publish --access-public"},"author":{"name":"Darvesh"},"license":"MIT","dependencies":{"highlight.js":"^10.3.1"},"devDependencies":{"@types/chai":"^4.2.14","@types/chai-as-promised":"^7.1.3","@types/mocha":"^8.0.3","@types/node":"^14.14.2","@typescript-eslint/eslint-plugin":"^4.5.0","@typescript-eslint/parser":"^4.5.0","chai":"^4.2.0","chai-as-promised":"^7.1.1","eslint":"^7.12.0","eslint-config-prettier":"^6.14.0","eslint-plugin-prettier":"^3.1.4","mocha":"^8.2.0","prettier":"^2.1.2","ts-node":"^9.0.0","typescript":"^4.0.3"},"prettier":{"tabWidth":4,"useTabs":true,"singleQuote":false,"trailingComma":"none","arrowParens":"avoid","printWidth":80},"repository":{"type":"git","url":"git+https://github.com/darvesh/portray.git"},"bugs":{"url":"https://github.com/darvesh/portray/issues"},"homepage":"https://github.com/darvesh/portray#readme","gitHead":"63c76eaa51be2e26112e859419ebaba11163a75a","_id":"@darvesh/portray@0.5.4","_nodeVersion":"15.0.1","_npmVersion":"7.0.3","dist":{"integrity":"sha512-7nrP2iShYsSqsKaH6kxJhQ9nj7Gw6r+UzEo3SNtP5gp4ADEgZN8icIMgAn59tp0UtKGeI12/WDWlN+jb0KPeRA==","shasum":"1275338656822f200ebbe2c239f178077bc5d774","tarball":"https://registry.npmjs.org/@darvesh/portray/-/portray-0.5.4.tgz","fileCount":21,"unpackedSize":384043,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoIKdCRA9TVsSAnZWagAAtnUP/AncA91r8UGBbRJHGiXC\nsGSWKe0lOsCYdIE8FdxxvRpdywbc/j/vL6sJjkLfJhc2+bOb87TtiBZ6DFTS\nheUzsf+0VSKvYMj7RlGQ8jxlSi8t6vA8XH3lSE1+LTh909f7ZXcPJYWauBmA\nFVSmUPEYjNSderYw6gso6Q0ZqLRtdMW0fODm11duNrD0Ncse/QoqxBJ/6z4x\nUJk9SMYZEsYAvxmz/f0MRJfjd1CahR2G2LK4mF82Qf6WqFG65B4ndQB9Nu2v\nZCvOU0aSiZXuCSKzfRUaoH7wI5xNrOXfDrQIB/xgagMnqG1HlX8ajiADjh0I\nPDZuotys2XdSNukw5Prp/6SUwfoqKzV4n4fm2lMJfZ9OH1kT5cK0jW59wSYt\nMZjLtXKEE1sM6fAPzOaeyxsG89rM+s7TAzIXgpNSOjy8Un6NUiX3/1QMnDoL\nEqEON/e3YSfjJLm/SfVC8L6BD5tnqMNnrOFRcyL+fV7WNiU9/JBaqppzzaXB\nATEVUZfWuzKxPGv1PXmyqnTDedj5ol/07wATlM2ucSRY2zu53ucXha+2uiXs\naYGLHHkoQgiXAIsYma3PKeSG1tiPxpQb1dfcbrPpj5vfPbcMYqHJwuKPEb6h\njRFqFkE0LsDo2udCfyLef8deE0GsyEwiGJDYPbKL8gobkbnE51NBPif8C/zy\n8lWO\r\n=ITEx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID7abKzGL1nhtW1EiNLoZSBTYbaw1CK5EzXGyd1Yt7uQAiBKpfWW8b1ll+nxu+cPjeogfJOrBwjrSNo0eUmFSD1BZA=="}]},"maintainers":[{"name":"darvesh","email":"drvsh@protonmail.com"}],"_npmUser":{"name":"darvesh","email":"drvsh@protonmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/portray_0.5.4_1604354717039_0.5037725250573442"},"_hasShrinkwrap":false}},"maintainers":[{"name":"darvesh","email":"drvsh@protonmail.com"}],"description":"Generate beautiful image from your source code","homepage":"https://github.com/darvesh/portray#readme","repository":{"type":"git","url":"git+https://github.com/darvesh/portray.git"},"author":{"name":"Darvesh"},"bugs":{"url":"https://github.com/darvesh/portray/issues"},"license":"MIT","readme":"<p align=\"center\">\n  <img src=\"https://img.techpowerup.org/201102/logo402.png\" alt=\"Portray\"/>\n</p>\n\n\n> Generate beautiful image from your source code :night_with_stars:\n\n<br/>\n\n## Dependency\n\n  You need to have wkhtmltopdf installed on your system to use this package. \n  \n  Download it from here https://wkhtmltopdf.org/downloads.html#stable or\n  ```sh\n  $ apt install wkhtmltopdf #debian #ubuntu #mint\n  $ pacman -S wkhtmltopdf #archlinux\n  $ dnf install wkhtmltopdf #fedora, centos, opensuse\n  ```\n  If you are on windows, download the binary the above mentioned website, install it, and add it to PATH.\n\n\n## Install\n\n```sh\n$ npm install @darvesh/portray\n```\n\n## Usage\n\n```TypeScript\nimport { generate } from \"@darvesh/portray\";\n\ngenerate(code)\n  .then(buffer => {\n    if(buffer instanceof Buffer) \n      return fs.promises.writeFile(\"./image.jpeg\", buffer);\n  })\n  .then(() => console.log(\"Image saved\"))\n  .catch(console.error)\n\n```\n\n```TypeScript\nimport { generate } from \"@darvesh/portray\";\nimport { Readable } from \"stream\";\n\nconst options = {\n  borderColor: \"#90FE13\",\n  fontSize: 18,\n  format: \"png\",\n  theme: \"nord\",\n  stream: true,\n  windowControl: 1\n}\n\ngenerate(code, options)\n  .then(stream => {\n    if(stream instanceof Readable){\n      const image = fs.createWriteStream(\"./image.png\");\n      stream.pipe(image); \n    }\n  })\n  .catch(console.error)\n\n```\n## Output\n<img src=\"https://img.techpowerup.org/201102/default.jpg\"/>\n<br /><br />\n\n## Options\n\n**`fontSize?: number;`**\n> **Default**: 25  (in px)\n\n**`fontPath?: string;`**\n> **Default**: FiraCode Regular\\\n> **Supported Font Format**: `ttf`, `woff`, and `woff2`\\\n> **Condition**: Provide absolute path of font file. Use `path.resolve(__dirname, \"/path/to/font\")`\n\n**`stream?: true`**\n> **Default**: false\\\n> `true` to return `Stream.Readable` instead of `Buffer`\n\n**`borderColor?: string`**\n> **Default**: `\"#ABB8C3\"`\\\n> **Example**: `\"yellow\"`, `\"#000000\"`\n\n**`borderSize?: number`**\n> **Default**: `25` (in px)\n\n**`language?: string`**\n> **Example**: `\"javascript\"`, `\"rust\"`\n\n**`theme?: ThemesType`**\n> **Default**: `\"dracula\"`\\\n> **Refer**: [ThemesType](https://github.com/darvesh/portray/blob/master/src/template/cssTheme.ts)\n\n**`windowControl?: 0 | 1 | 2 | 3`**\n> **Default**: 1\\\n> 0 if you don't want windowControl \n<div style=\"display: flex;\">\n  <span style=\"margin-left: 10px;\"> \n    1. <img src=\"https://img.techpowerup.org/201102/windowcontrol1.png\" height=\"25px\" width=\"50px\" alt=\"1\"/> \n  </span>\n  <span style=\"margin-left: 10px;\"> \n    2. <img src=\"https://img.techpowerup.org/201102/windowcontrol2.png\" height=\"25px\" width=\"50px\" alt=\"2\"/>\n  </span>\n  <span style=\"margin-left: 10px;\"> \n    3. <img src=\"https://img.techpowerup.org/201102/windowcontrol3.png\" height=\"25px\" width=\"50px\" alt=\"3\"/> \n  </span>\n</div>\n<br/>\n<hr/>\n\n## Credits\nThanks to [Muthu](https://github.com/mkrhere), [Thomas](https://github.com/trgwii) and [Ceda](https://github.com/ceda-ei)","readmeFilename":"README.md"}