New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ttf2woff2

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ttf2woff2 - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

binding.gyp

16

package.json
{
"name": "ttf2woff2",
"version": "1.0.2",
"version": "1.1.0",
"description": "Convert TTF files to WOFF2 ones.",

@@ -13,3 +13,6 @@ "main": "src/index.js",

"cover": "./node_modules/istanbul/lib/cli.js cover --report html ./node_modules/mocha/bin/_mocha -- tests/*.mocha.js -R spec -t 5000",
"cli": "env NPM_RUN_CLI=1"
"cli": "env NPM_RUN_CLI=1",
"configure": "node-gyp configure",
"make": "node-gyp build",
"install": "(node-gyp rebuild > builderror.log) || (exit 0)"
},

@@ -32,3 +35,5 @@ "repository": {

"dependencies": {
"bufferstreams": "^1.0.1"
"bufferstreams": "^1.0.1",
"bindings": "~1.2.1",
"nan": "~1.3.0"
},

@@ -40,3 +45,3 @@ "devDependencies": {

"istanbul": "~0.3.14",
"sax": "~1.1.1"
"node-gyp": "^2.0.1"
},

@@ -46,3 +51,4 @@ "preferGlobal": "true",

"ttf2woff2": "bin/ttf2woff2.js"
}
},
"gypfile": true
}

@@ -1,23 +0,5 @@

var theTTFToWOFF2Module = require('../build/ttf2woff2');
module.exports = function ttf2woff2(inputContent) {
// Prepare input
var inputBuffer = theTTFToWOFF2Module._malloc(inputContent.length + 1);
var outputSizePtr = theTTFToWOFF2Module._malloc(4);
theTTFToWOFF2Module.writeArrayToMemory(inputContent, inputBuffer);
// Run
var outputBufferPtr = theTTFToWOFF2Module._TTFToWOFF2(inputBuffer, inputContent.length + 1, outputSizePtr);
// Retrieve output
var outputSize = theTTFToWOFF2Module.getValue(outputSizePtr, 'i32');
var outputContent = new Buffer(outputSize);
for(var i = 0; i < outputSize; i++ ) {
outputContent[i] = theTTFToWOFF2Module.getValue(outputBufferPtr + i, 'i8');
}
return outputContent;
}
try {
module.exports = require('bindings')('addon.node').convert;
} catch(err) {
module.exports = require('../jssrc/index.js');
}
var fs = require('fs');
var ttf2woff2 = require('../src/index');
var assert = require('assert');

@@ -7,4 +6,5 @@

it('should work', function(done) {
this.timeout(5000);
it('should work from the main endpoint', function(done) {
this.timeout(10000);
var ttf2woff2 = require('../src/index');
var inputContent = fs.readFileSync(__dirname + '/expected/iconsfont.ttf');

@@ -18,2 +18,23 @@ assert.deepEqual(

it('should work from the native build', function(done) {
var ttf2woff2 = require('bindings')('addon.node').convert;
var inputContent = fs.readFileSync(__dirname + '/expected/iconsfont.ttf');
assert.deepEqual(
ttf2woff2(inputContent),
fs.readFileSync(__dirname + '/expected/iconsfont.woff2')
);
done();
});
it('should work from the emscripten endpoint', function(done) {
this.timeout(10000);
var ttf2woff2 = require('../jssrc/index.js');
var inputContent = fs.readFileSync(__dirname + '/expected/iconsfont.ttf');
assert.deepEqual(
ttf2woff2(inputContent),
fs.readFileSync(__dirname + '/expected/iconsfont.woff2')
);
done();
});
});

Sorry, the diff of this file is not supported yet

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