Security News
How Threat Actors are Abusing GitHub’s File Upload Feature to Host Malware
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
cnf-barcode
Advanced tools
Readme
author: bugszhou | Email:bugszhou@outlook.com
description: a barcode generator
本库基于JsBarcode核心库修改,仅生成svg格式图片和svg的DataURL文本(data:image/svg+xml;utf8,........
),主要用于非标准dom和无dom结构中使用。
cnf-barcode is a barcode generator written in JavaScript. It supports multiple barcode formats and works in browsers and with Node.js. It has no dependencies when it is used for the web but works with jQuery if you are into that.
Use dataURI
let barcode = cnfBarcode("Hi!").getSvgDataURI();
data:image/svg+xml;utf8,........
let barcode = cnfBarcode("Hi!").getSvg();
// or use DataURL
let barcode = cnfBarcode("Hi!").getSvgDataURI();
cnfBarcode("1234", {
format: "pharmacode",
lineColor: "#f4a460",
width:4,
height:40,
displayValue: false
});
let barcode = cnfBarcode().options({font: "OCR-B"}) // Will affect all barcodes
.EAN13("1234567890128", {fontSize: 18, textMargin: 0})
.blank(20) // Create space between the barcodes
.EAN5("12345", {height: 85, textPosition: "top", fontSize: 16, marginTop: 15})
.render().getSvg();
You can also use Bower or npm to install and manage the library.
bower install cnf-barcode --save
npm install cnf-barcode --save
For information about how to use the options, see the wiki page.
Option | Default value | Type |
---|---|---|
format | "auto" (CODE128) | String |
width | 2 | Number |
height | 100 | Number |
displayValue | true | Boolean |
text | undefined | String |
fontOptions | "" | String |
font | "monospace" | String |
textAlign | "center" | String |
textPosition | "bottom" | String |
textMargin | 2 | Number |
fontSize | 20 | Number |
background | "#ffffff" | String (CSS color) |
lineColor | "#000000" | String (CSS color) |
margin | 10 | Number |
marginTop | undefined | Number |
marginBottom | undefined | Number |
marginLeft | undefined | Number |
marginRight | undefined | Number |
valid | function(valid){} | Function |
FAQs
a barcode generator
The npm package cnf-barcode receives a total of 25 weekly downloads. As such, cnf-barcode popularity was classified as not popular.
We found that cnf-barcode demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.