First release
This commit is contained in:
commit
fa6c85266e
2339 changed files with 761050 additions and 0 deletions
15
node_modules/nes.css/scripts/getFileAsDataURI.js
generated
vendored
Normal file
15
node_modules/nes.css/scripts/getFileAsDataURI.js
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
const filetype = require('file-type');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
/* eslint-enable */
|
||||
|
||||
module.exports = (fileString) => {
|
||||
const filepath = path.resolve(__dirname, fileString.getValue());
|
||||
const fileBuffer = fs.readFileSync(filepath);
|
||||
|
||||
const fileDataURI = fileBuffer.toString('base64');
|
||||
const { mime } = filetype(fileBuffer);
|
||||
|
||||
return `data:${mime};base64,${fileDataURI}`;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue