npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

inject-typekit-script-stream

1.0.3

@yoshuawuyts

npmHomeRepoSnykSocket
Downloads:0
$ npm install inject-typekit-script-stream
DailyWeeklyMonthlyYearly

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

  • inject-lr-script-stream
  • simple-html-index

License

MIT