Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
ficons-webfont-generator
Advanced tools
Ficons Generator of webfonts from SVG icons.
Features:
npm install --save-dev ficons-webfont-generator
const ficonswebfont = require('ficons-webfont-generator');
ficonswebfont({
files: [
'src/dropdown.svg',
'src/close.svg',
],
dest: 'dest/',
}, function(error) {
if (error) {
console.log('Fail!', error);
} else {
console.log('Done!');
}
})
Type: object
Object with options. See the list of options.
Type: function(error, result)
required
Type: array.<string>
List of SVG files.
required
Type: string
Directory for generated font files.
Type: string
Default: 'iconfont'
Name of font and base name of font files.
Type: boolean
Default: true
Whether to generate CSS file.
Type: string
Default: path.join(options.dest, options.fontName + '.css')
Path for generated CSS file.
Type: string
Default: path of default CSS template
Path of custom CSS template. Generator uses handlebars templates.
Template receives options from options.templateOptions
along with the following options:
string
– Value of the src
property for @font-face
.object
– Codepoints of icons in hex format.Paths of default templates are stored in the ficonswebfont.templates
object.
ficonswebfont.templates.css
– Default CSS template path.
It generates classes with names based on values from options.templateOptions
.
ficonswebfont.templates.scss
– Default SCSS template path.
It generates mixin webfont-icon
to add icon styles.
It is safe to use multiple generated files with mixins together.
Example of use:
@import 'iconfont';
.icon { @include webfont-icon('icon'); }
Type: string
Default: options.destCss
Fonts path used in CSS file.
Type: boolean
Default: false
Whether to generate HTML preview.
Type: string
Default: path.join(options.dest, options.fontName + '.html')
Path for generated HTML file.
Type: string
Default: templates/html.hbs
HTML template path. Generator uses handlebars templates.
Template receives options from options.templateOptions
along with the following options:
string
– Styles generated with default CSS template.
(cssFontsPath
is chaged to relative path from htmlDest
to dest
)array.<string>
– Names of icons.Type: object
Additional options for CSS & HTML templates, that extends default options.
Default options are:
{
classPrefix: 'icon-',
baseSelector: '.icon'
}
Type: array<string>
Default: ['woff2', 'woff', 'eot']
Font file types to generate.
Possible values: svg, ttf, woff, woff2, eot
.
Type: array<string>
Default: ['eot', 'woff2', 'woff', 'ttf', 'svg']
Order of src
values in font-face
in CSS file.
Type: function(string) -> string
Default: basename of file
Function that takes path of file and return name of icon.
Type: number
Default: 0xF101
Starting codepoint. Defaults to beginning of unicode private area.
Type: object
Specific codepoints for certain icons.
Icons without codepoints will have codepoints incremented from startCodepoint
skipping duplicates.
Options that are passed directly to svgicons2svgfont.
Type: object
Specific per format arbitrary options to pass to the generator
format and matching generator:
svg
- svgicons2svgfont.ttf
- svg2ttf.woff2
- ttf2woff2.woff
- ttf2woff.eot
- ttf2eot.ficonswebfont({
// options
formatOptions: {
// options to pass specifically to the ttf generator
ttf: {
ts: 1451512800000
}
}
}, function(error, result) {})
Type: boolean
Default: true
It is possible to not create files and get generated fonts in object
to write them to files later.
Also results object will have function generateCss([urls])
where urls
is an object with future fonts urls.
ficonswebfont({
// options
writeFiles: false
}, function(error, result) {
// result.eot, result.ttf, etc - generated fonts
// result.generateCss(urls) - function to generate css
})
Public domain, see the LICENCE
file.
FAQs
Generator of webfonts from svg icons
The npm package ficons-webfont-generator receives a total of 3 weekly downloads. As such, ficons-webfont-generator popularity was classified as not popular.
We found that ficons-webfont-generator 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.