JSPM

node-text2img

0.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q38967F
  • License MIT

Package Exports

  • node-text2img

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-text2img) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

node-text2img

npm

npm install node-text2img
const t2i = require("./index");
const text = "Your Text\nHere!";
// configs can be omitted
const configs = {
    font: {
        font: "24px 宋体",
        fontHeight: 24,
        fontMaxWidth: 24,
        fillStyle: "black",
    },
    size: {
        maxCharsPerLine: 50,
        paddingX: 24,
        paddingY: 24,
    }
};
const base64Url = new t2i(text, configs).text2img(); // base64 url like "data:image/png;base64,#picdata#"
console.log(base64Url);