Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

iconfont-map-builder

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iconfont-map-builder - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

codepoint.js

22

index.js

@@ -10,2 +10,3 @@ #!/usr/bin/env node

var CSSOM = require('cssom');
var Common = require('./common');

@@ -35,21 +36,12 @@

var content = elem.style.content.replace(/"\\([0-9a-z]+)"/,'0x$1');
map[String(matched[nameGrp])] = parseInt(content);
map[matched[nameGrp]] = parseInt(content);
}
}
});
var output = [
"/** Created by iconfont-map-builder */",
"var map =",
JSON.stringify(map),
";module.exports = (name)=>String.fromCharCode(map[name]);"];
fs.writeFileSync(mapFile,output.join('\n'));
}
function printUsage(){
console.log([
'Usage:',
"iconmap -f <css file> -p <extract pattern> [-n] [group number of icon's name in the regexp pattern,default 1]"
].join('\n'));
fs.writeFileSync(mapFile,Common.generateModule(map));
}
if(require.main === module){

@@ -59,3 +51,3 @@ try {

if (argv.indexOf('-h')>-1 || argv.indexOf('--help')>-1) {
printUsage();
Common.printUsage();
return;

@@ -73,5 +65,5 @@ } else if (argv.indexOf('-f') > 0 && argv.indexOf('-p') > 0) {

}
printUsage();
Common.printUsage();
}else{
module.exports = buildCss;
}
{
"name": "iconfont-map-builder",
"version": "1.0.1",
"version": "1.0.2",
"description": "Transform iconfont's css file to js 'name-character' map ",

@@ -10,3 +10,4 @@ "main": "index.js",

"bin":{
"iconmap":"./index.js"
"iconmap":"./index.js",
"iconmap-codepoint":"./codepoint.js"
},

@@ -13,0 +14,0 @@ "repository":{

# iconfont-map-builder
Simple command tool to transform iconfont's css file to a js mapping moudle .
Simple command tool to transform iconfont's css/codepoint file to a js mapping moudle .
I'm using the module in [react-native-iconic-font](<https://github.com/sospartan/react-native-iconic-font>) to generate the iconic map file
## Usage

@@ -5,0 +7,0 @@ install this tool via npm

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc