https://github.com/exsper/node-text2img
https://github.com/exsper/node-text2img
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/exsper/node-text2img
- Owner: Exsper
- License: mit
- Created: 2020-11-08T11:50:34.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-08T12:49:46.000Z (over 5 years ago)
- Last Synced: 2025-10-25T15:42:57.580Z (8 months ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-text2img
[](https://www.npmjs.com/package/node-text2img)
```
npm install node-text2img
```
```javascript
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);
```