inject-typekit-script-stream
v1.0.3
Published
Streamingly inject a Typekit kit script into html
Downloads
8
Maintainers
Readme
inject-typekit-script-stream
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
.