inject-typekit-script-stream

1.0.3 • Public • Published

inject-typekit-script-stream

NPM version build status Test coverage Downloads js-standard-style

Streamingly inject a Typekit kit script into html. This should probably only be done when prototyping, as the script itself is a non-negligable 0.3MB, where your typical font only weighs 0.01MB.

Installation

$ npm install inject-typekit-script-stream

Usage

const tk = require('inject-typekit-script-stream')
const filed = require('filed')
const http = require('http')
 
http.createServer((req, res) => {
  filed(__dirname + '/index.html')
    .pipe(tk({ kitId: 'ehq9vim' }))
    .pipe(res)
})

API

tk(opts)

Create a duplex inject stream. Expects a <body> tag to be present. The following opts are available:

  • kitId: The unique id for your Typekit font kit. You can find this under kits -> <select kit> -> embed code.

See Also

License

MIT

Dependents (0)

Package Sidebar

Install

npm i inject-typekit-script-stream

Weekly Downloads

0

Version

1.0.3

License

MIT

Last publish

Collaborators

  • yoshuawuyts