Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ice-hazymoon/idcard_generator
身份证生成器
https://github.com/ice-hazymoon/idcard_generator
Last synced: 5 days ago
JSON representation
身份证生成器
- Host: GitHub
- URL: https://github.com/ice-hazymoon/idcard_generator
- Owner: Ice-Hazymoon
- Created: 2019-05-02T14:45:45.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-13T00:28:16.000Z (almost 2 years ago)
- Last Synced: 2024-12-22T11:07:53.827Z (12 days ago)
- Language: JavaScript
- Size: 8.69 MB
- Stars: 412
- Watchers: 8
- Forks: 151
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# idcard-generator
> 使用 nodejs 生成身份证
>
> 本工具仅供研究使用,请勿用于违法用途,否则后果自负## 使用
```javascript
const idcardGenerator = require('idcard-generator');
const config = {
name: '喵喵喵',
sex: '女',
nation: '汉',
year: '3000',
mon: '2',
day: '31',
org: '喵喵县公安局',
validTerm: '2014.02.31-2019.02.31',
addr: '云南省昆明市喵喵区汪汪路呱呱小区5栋1806',
idn: '111111111111111111',
avatar: './images/avatar.png'
}
idcardGenerator(config).then(e => {
fs.writeFile('./output.png', e, err => {
if (err) {
console.log(err);
} else {
console.log('保存成功');
}
})
}).catch(err => {
console.log('idcard-generator:测试失败\n' + err.stack);
});
```## 其他
参考项目:[https://github.com/airob0t/idcardgenerator](https://github.com/airob0t/idcardgenerator)
根据在 [https://github.com/airob0t/idcardgenerator](https://github.com/airob0t/idcardgenerator) 下载的PSD文件,以自己的身份证作为标准,做了一些大的调整,修改了一些字体和布局