Comparing version 1.0.2 to 1.1.0
{ | ||
"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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
11463904
121
1079
3
1
24
+ Addedbindings@~1.2.1
+ Addednan@~1.3.0
+ Addedbindings@1.2.1(transitive)
+ Addednan@1.3.0(transitive)