$ npm install @ginpei/rad-extract-webfont-kit
const extractKit = require('@ginpei/rad-extract-webfont-kit');
extractKit({
outDir: 'path/to/out-dir/',
zipPath: 'path/to/zip-file',
}, (error, result) => {
if (error) {
console.error(error);
return;
}
process.stdout.write('Done:', result);
});
Tests require test asset zip files, which require a key to download.
You have to get the key to download files. The key is defined in the AWS S3 bucket policy as referrer URL.
Find it in S3 bucket → Permissions → Bucket Policy.
"aws:Referer": "https://responsiveads.com/rad-extract-webfont-kit/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
DOWNLOAD_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx npm run download-test-assets
npm run test
Use npm link
to use this directory from your project.
Step 1/2: In this directory, create a link:
$ npm link
Step 2/2: In the directory of your project where you use this lib:
$ npm link @ginpei/rad-extract-webfont-kit
Now require('@ginpei/rad-extract-webfont-kit')
imports this working directory instead of the things downloaded from npm.