{"id":16231528,"url":"https://github.com/hustcc/alimask","last_synced_at":"2025-05-07T15:21:03.107Z","repository":{"id":57176127,"uuid":"91048365","full_name":"hustcc/alimask","owner":"hustcc","description":":mask: alimask 是一个使用 canvas 生成类似阿里巴巴内部网站水印图片的 JavaScript 库。","archived":false,"fork":false,"pushed_at":"2018-08-23T12:17:54.000Z","size":14,"stargazers_count":176,"open_issues_count":6,"forks_count":42,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-06T12:49:15.931Z","etag":null,"topics":["alibaba","alimask","antfin","canvas","mask","page-watermark","water","watermark","watermark-image"],"latest_commit_sha":null,"homepage":"http://git.hust.cc/alimask/","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/hustcc.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":"2017-05-12T03:40:59.000Z","updated_at":"2023-01-31T08:46:52.000Z","dependencies_parsed_at":"2022-08-28T01:40:55.271Z","dependency_job_id":null,"html_url":"https://github.com/hustcc/alimask","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Falimask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Falimask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Falimask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Falimask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hustcc","download_url":"https://codeload.github.com/hustcc/alimask/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252902717,"owners_count":21822288,"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","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":["alibaba","alimask","antfin","canvas","mask","page-watermark","water","watermark","watermark-image"],"created_at":"2024-10-10T13:05:58.059Z","updated_at":"2025-05-07T15:21:03.083Z","avatar_url":"https://github.com/hustcc.png","language":"JavaScript","readme":"# alimask\n\n\u003e **alimask** 是一个使用 canvas 生成类似阿里巴巴内部网站水印图片的 JavaScript 库。Online demo [here](http://git.hust.cc/alimask/).\n\n![](alimask.png)![](alimask.png)![](alimask.png)\n\n[![Build Status](https://travis-ci.org/hustcc/alimask.svg?branch=master)](https://travis-ci.org/hustcc/alimask) [![npm](https://img.shields.io/npm/v/alimask.svg)](https://www.npmjs.com/package/alimask) [![npm](https://img.shields.io/npm/dt/alimask.svg)](https://www.npmjs.com/package/alimask) [![npm](https://img.shields.io/npm/l/alimask.svg)](https://www.npmjs.com/package/alimask)\n\n\n# 1. Install\n\n\u003e **npm install alimask**\n\nThen import it.\n\n```js\n\u003cscript type=\"text/javascript\" src=\"dist/alimask.min.js\"\u003e\u003c/script\u003e\n// or\nvar alimask = require('alimask');\n// or\nimport alimask from 'alimask';\n```\n\nThen use **alimask(text, options)** API.\n\n```js\nalimask('王小为(小为) 888888');\n\nalimask('王小为(小为) 888888', { color: '#f6dcd7' });\n\nalimask('小泥巴(小美) 888888', { alpha: 0.5 });\n```\n\n\n# 2. API\n\nThe unique API is: **alimask(text, options)**.\n \n - **text** (String): required, the text in the watermark image. \n - **options** (Object): optional, the options of watermark, with keys below:\n   - **width** (Number): default is `250`.\n   - **height** (Number): default is `80`.\n   - **color** (String): the text color, default is `#ebebeb`.\n   - **alpha** (Float): the text alpha(0 ~ 1), default is `0.8`.\n   - **font** (String): the text font style, default is `10px Arial`.\n\nThe api return **the base64 string of watermark image** which can be used in css background / img tag.\n\n\n# 3. Build \u0026 Test\n\n\u003e npm install\n\n\u003e npm run build\n\n\u003e npm test\n\n\n# 4. LICENSE\n\nMIT @[hustcc](https://github.com/hustcc)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhustcc%2Falimask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhustcc%2Falimask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhustcc%2Falimask/lists"}