What is @jspm/core?
@jspm/core is a modern JavaScript package manager that allows you to import npm packages directly in the browser or in Node.js without needing a bundler. It supports ES modules and provides a CDN for quick and easy package loading.
What are @jspm/core's main functionalities?
Importing npm packages in the browser
This feature allows you to import npm packages directly in the browser using ES module syntax. The example demonstrates importing the lodash library and using its random function.
import { lodash } from 'https://jspm.dev/lodash';
console.log(lodash.random(1, 100));
Importing npm packages in Node.js
This feature allows you to import npm packages in a Node.js environment using ES module syntax. The example shows how to import and use the lodash library in Node.js.
import { lodash } from '@jspm/core/nodelibs/lodash';
console.log(lodash.random(1, 100));
Using the JSPM CDN
JSPM provides a CDN for quick and easy package loading. The example demonstrates importing the moment library from the JSPM CDN and using it to format the current date and time.
import { moment } from 'https://jspm.dev/moment';
console.log(moment().format('MMMM Do YYYY, h:mm:ss a'));
Other packages similar to @jspm/core
unpkg
unpkg is a fast, global content delivery network for everything on npm. It allows you to load any file from any package using a URL. Unlike @jspm/core, unpkg does not provide a module resolution system and relies on the package's main entry point.
skypack
Skypack is a CDN for modern JavaScript that makes it easy to load npm packages in the browser. It automatically optimizes packages for browser usage and supports ES modules. Skypack is similar to @jspm/core in that it provides a CDN and supports ES modules, but it focuses more on optimization and performance.
esm.sh
esm.sh is a CDN that converts npm packages to ES modules. It allows you to import npm packages directly in the browser with ES module syntax. Like @jspm/core, esm.sh supports ES modules and provides a CDN, but it focuses on converting CommonJS modules to ES modules.
jspm 2 core libraries
This package contains the core libraries used in jspm 2.
Currently this is only the nodelibs/
folder implementing the optimized browser versions of the Node.js builtins.
Updates and PRs to this repo to implement the latest Node.js APIs are welcome.
LICENSE
Apache 2.0