# text2watermark

> convert text to watermark.

Latest version **1.0.8** (published 2021-11-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install text2watermark
pnpm add text2watermark
yarn add text2watermark
bun add text2watermark
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2021-11-17 |
| First published | 2021-11-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 14.5 MB |
| Known vulnerabilities | 0 (+5 in 2 direct dependencies) |
| Install scripts | no |
| Author | wen |
| Maintainers | shonn |
| Keywords | convert, text, watermark, path, pathdata, graphics, fonts |

## Links

- npm: https://www.npmjs.com/package/text2watermark
- Homepage: https://github.com/Shonn-Zhang/text2watermark
- npm.io page: https://npm.io/package/text2watermark

## Dependencies (4)

- [path](https://npm.io/package/path.md) ^0.12.7
- [sharp](https://npm.io/package/sharp.md) ^0.29.3
- [images](https://npm.io/package/images.md) ^3.2.3
- [text2svg](https://npm.io/package/text2svg.md) ^1.0.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.8 (latest) — 2021-11-17
- 1.0.7 — 2021-11-17
- 1.0.6 — 2021-11-17
- 1.0.5 — 2021-11-17
- 1.0.4 — 2021-11-17
- 1.0.3 — 2021-11-17
- 1.0.2 — 2021-11-17
- 1.0.1 — 2021-11-17
- 1.0.0 — 2021-11-17

## README

Node.js 图片添加文字水印库

## Installation 安装
	$ npm install text2watermark


## Demo 例子
``` javascript
const text2watermark = require('text2watermark')
const watermarkBuffer = await = text2watermark.convert(buffer,'测试水印')                 
```

## Features 功能特性

* 基于images库,实现了添加文字做水印的功能
* 内置了微软雅黑字体,可以调用时传入其他字库
* 方便node接口调用,输入输出图像都是Buffer类型

## Installation 安装
	$ npm install images

## API 接口


### convert(buffer, text, options, font)
从Buffer数据中解码图像,添加文字水印

#### :options
配置项[非必要]
```$xslt
{
    fontSize: 14, 
    path: {'fill': 'black'}, // 文字颜色
    position:{x:10,y:10} // 相对原图右下角位置的偏移
} 
```
#### :font[path/to/xxx.ttf]
外部字体库[非必要]

---
_Source: https://npm.io/package/text2watermark · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
