Socket
Book a DemoInstallSign in
Socket

inject-typekit-script-stream

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inject-typekit-script-stream

Streamingly inject a Typekit kit script into html

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

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

Keywords

html

FAQs

Package last updated on 03 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts