All Projects → postui → Esm.sh

postui / Esm.sh

Licence: mit
A fast, global content delivery network for ES Modules.

Programming Languages

go
31211 projects - #10 most used programming language
js
455 projects

Projects that are alternatives of or similar to Esm.sh

Cdnjs
🤖 CDN assets - The #1 free and open source CDN built to make life easier for developers.
Stars: ✭ 9,270 (+2194.55%)
Mutual labels:  cdn, fast
Jsdelivr
A free, fast, and reliable Open Source CDN for npm, GitHub, Javascript, and ESM
Stars: ✭ 4,052 (+902.97%)
Mutual labels:  cdn, npm
Geotic
Entity Component System library for javascript
Stars: ✭ 97 (-75.99%)
Mutual labels:  npm, fast
Webpack Cdn Plugin
A webpack plugin that use externals of CDN urls for production and local node_modules for development
Stars: ✭ 306 (-24.26%)
Mutual labels:  cdn, npm
Npm Consider
Check package dependencies before installing it
Stars: ✭ 386 (-4.46%)
Mutual labels:  npm
Hukum
An NPM module that displays Github Action progress in the terminal and aims to improve your development experience by printing status in realtime.
Stars: ✭ 375 (-7.18%)
Mutual labels:  npm
Front End Doc
前端文档汇总(觉得对您有用的话,别忘了star收藏哦^_^ !)
Stars: ✭ 372 (-7.92%)
Mutual labels:  npm
Node Csgo
A node-steam plugin for Counter-Strike: Global Offensive.
Stars: ✭ 367 (-9.16%)
Mutual labels:  npm
Nupdate
A comfortable update solution for .NET-applications.
Stars: ✭ 394 (-2.48%)
Mutual labels:  fast
Smartbanner.js
Customisable smart app banners for iOS and Android
Stars: ✭ 391 (-3.22%)
Mutual labels:  npm
Awesome Npm
Awesome npm resources and tips
Stars: ✭ 3,894 (+863.86%)
Mutual labels:  npm
Npminstall
Make `npm install` fast and easy.
Stars: ✭ 374 (-7.43%)
Mutual labels:  npm
Stmux
Simple Terminal Multiplexer for Node.js Environments
Stars: ✭ 388 (-3.96%)
Mutual labels:  npm
Website
Yarn package manager website
Stars: ✭ 374 (-7.43%)
Mutual labels:  npm
Lein template descjop
A Leiningen template(Clojure/ClojureScript Project) for Web based desktop application with Electron (atom-shell).
Stars: ✭ 394 (-2.48%)
Mutual labels:  npm
Epub Press Clients
📦 Clients for building books with EpubPress.
Stars: ✭ 370 (-8.42%)
Mutual labels:  npm
Onelog
Dead simple, super fast, zero allocation and modular logger for Golang
Stars: ✭ 389 (-3.71%)
Mutual labels:  fast
Awesome Wp Speed Up
Plugins and resources to speed up and optimize your WordPress site.
Stars: ✭ 375 (-7.18%)
Mutual labels:  cdn
Npx card
use npx anmol to connect with me
Stars: ✭ 377 (-6.68%)
Mutual labels:  npm
Ws
Tiny WebSocket library for Go.
Stars: ✭ 4,267 (+956.19%)
Mutual labels:  fast

ESM

A fast, global content delivery network for ES Modules. All modules are transformed to ESM by esbuild in NPM.

Import from URL

import React from 'https://esm.sh/react'

Specify version

import React from 'https://esm.sh/[email protected]'

Submodule

import { renderToString } from 'https://esm.sh/react-dom/server'

or import non-module(js) files:

import 'https://esm.sh/tailwindcss/dist/tailwind.min.css'

Specify ESM target

import React from 'https://esm.sh/react?target=es2020'

Avaiable target: es2015 - es2020, esnext, and deno

Development mode

import React from 'https://esm.sh/react?dev'

Package CSS

import Daygrid from 'https://esm.sh/@fullcalendar/daygrid'
<link rel="styelsheet" href="https://esm.sh/@fullcalendar/daygrid?css">

Bundle mode

import React from 'https://esm.sh/[react,react-dom,swr]/react'
import ReactDom from 'https://esm.sh/[react,react-dom,swr]/react-dom'

or your can define the bundle list in import-map.json (import-maps proposal)

{
  "imports": {
    "react": "https://esm.sh/[react,react-dom,swr]/react",
    "react-dom": "https://esm.sh/[react,react-dom,swr]/react-dom",
    "swr": "https://esm.sh/[react,react-dom,swr]/swr",
    ...
  }
}
import React from 'react' // actual from 'https://esm.sh/[react,react-dom,swr]/react'

⚠️ The bundling packages in URL are litmited up to 10, to bundle more packages, please use the esm client (WIP).

Deno compatibility

esm.sh will replace the node internal modules (fs, os, etc) with deno.land/std/node to support some packages working in Deno, like postcss:

import postcss from 'https://esm.sh/postcss'
import autoprefixer from 'https://esm.sh/autoprefixer'

console.log((await postcss([ autoprefixer ]).process(`
  backdrop-filter: blur(5px);
  user-select: none;
`).async()).css)

X-Typescript-Types

By default, esm.sh will response a custom HTTP header of X-TypeScript-Types when the types(dts) defined, that is useful for deno types check (link).

figure #1

You can pass the no-check query to disable the X-TypeScript-Types header if some types are incorrect:

import unescape from 'https://esm.sh/lodash/unescape?no-check'

Caveats

Different with Skypack and jspm, esm.sh will bundle all dependencies(exclude peerDependencies) for each package, that means there may be redundant contents transmitted when you are importing multiple packages.
This should be improved when the http/3(quic) is ready. For now the best practice is using the bundle mode.

As optional, you can split code manually with the external query:

import React from 'https://esm.sh/[email protected]'
import useSWR from 'https://esm.sh/[email protected]'

Network of esm.sh

Self-Hosting

You will need Go 1.16+ to compile the server, and ensure supervisor installed on your host machine.
The server runtime will install the latest nodejs (14+ LTS) automatically.

$ git clone https://github.com/postui/esm.sh
$ cd esm.sh
$ sh ./scripts/deploy.sh

Special Thanks

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].