How to use the datauri function in datauri

To help you get started, we’ve selected a few datauri examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ezcater / sosia / packages / sosia-puppeteer / PuppeteerBrowserTarget.ts View on Github external
const toDataUri = (page: Page): string => {
  const html = `
    
    
    
    <style>
      ${page.css}
    </style>
    
    ${page.body}
  `;
  const htmlBuffer = Buffer.from(html, 'utf8');
  const datauri = new Datauri();
  datauri.format('.html', htmlBuffer);
  return datauri.content;
};
github timse / srcset-loader / src / placeholder-loader.js View on Github external
function bufferToDataUri(type, buffer) {
  return new DataUri().format(type, buffer).content;
}
github marmelab / svg_to_png / src / convertHtmlToDataUrl.js View on Github external
export default html => {
    const datauri = new Datauri();
    return datauri.format('.html', html).content;
};

datauri

Create DataURI scheme easily

MIT
Latest version published 3 years ago

Package Health Score

56 / 100
Full package analysis

Popular datauri functions