2.0.11 • Published 3 years ago

skypin v2.0.11

Weekly downloads
48
License
MIT
Repository
github
Last release
3 years ago

About

Skypack is a CDN built for browser modules. This module converts npm module id's into the optimized Skypack URL for optimal performance. Read more here. This could be used in build tools (like rollup) to convert source code into browser-optimized modules.

Usage

NodeJS

import { skypin } from 'skypin';

// Uses version of package found in node_modules (if it exists - otherwise 'latest')
await skypin('hueman')
// ~> https://cdn.skypack.dev/pin/hueman@v2.1.1-ElNqhC8YFxLlgRtjjL9o/min/hueman.js

await skypin('hueman', { pin: false })
// ~> https://cdn.skypack.dev/hueman@2.1.1

await skypin('hueman', { min: false })
// ~> https://cdn.skypack.dev/hueman@2.1.1

// Specify version directly
await skypin('hueman@2.0.0')
// ~> https://cdn.skypack.dev/pin/hueman@v2.0.0-Eh8v1x3dV0iEyJ9rG915/min/hueman.js

Browser Codepen

import { skypin } from 'https://cdn.skypack.dev/skypin'

await skypin('hueman')

API

skypin(module_id, options) -> URL

  • module_id: String that identifies the package in npm (hueman, uhtml@latest, themepark@1.0.0, etc.) (version number optional)
  • options:
    • pin: Boolean (default true). Read more here
    • min: Boolean (default true). Based on normal vs. minified in skypack lookup page
  • Returns: Promise that resolves to URL that can be used as an import statement in the browser

Uses the version of the package found in node_modules. Requires that the module has been installed to the current working directory. May take a few seconds if the package has not been "pinned" on skypack before.

References

License

MIT © Marshall Brandt

2.0.11

3 years ago

2.0.10

3 years ago

2.0.9

3 years ago

2.0.8

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.5

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.4

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

0.0.0

3 years ago