@ideditor/location-conflation
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "@ideditor/location-conflation", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"license": "ISC", | ||
@@ -23,5 +23,11 @@ "repository": "github:ideditor/location-conflation", | ||
"type": "module", | ||
"source": "./index.mjs", | ||
"main": "./dist/location-conflation.cjs", | ||
"module": "./index.mjs", | ||
"main": "./dist/location-conflation.cjs", | ||
"browser": "./dist/location-conflation.iife.js", | ||
"exports": { | ||
"require": "./dist/location-conflation.cjs", | ||
"import": "./index.mjs", | ||
"browser": "./dist/location-conflation.iife.js" | ||
}, | ||
"scripts": { | ||
@@ -32,3 +38,3 @@ "all": "run-s clean test", | ||
"build:browser": "esbuild ./index.mjs --platform=browser --format=iife --main-fields=module,main --global-name=LocationConflation --bundle --sourcemap --outfile=./dist/location-conflation.iife.js", | ||
"build:cjs": "esbuild ./index.mjs --platform=node --format=cjs --bundle --sourcemap --outfile=./dist/location-conflation.cjs", | ||
"build:cjs": "esbuild ./index.mjs --platform=node --format=cjs --sourcemap --outfile=./dist/location-conflation.cjs", | ||
"lint": "eslint index.mjs test/*.js", | ||
@@ -35,0 +41,0 @@ "tap": "tap --reporter terse --no-coverage test/*.js", |
@@ -51,9 +51,9 @@ [![build](https://github.com/ideditor/location-conflation/workflows/build/badge.svg)](https://github.com/ideditor/location-conflation/actions?query=workflow%3A%22build%22) | ||
**location-conflation** is distributed in several module formats for maxmimum compatibility. ([Read more about Javascript module formats](https://dev.to/iggredible/what-the-heck-are-cjs-amd-umd-and-esm-ikm)) | ||
**location-conflation** is distributed in CJS and ESM module formats for maxmimum compatibility. ([Read more about Javascript module formats](https://dev.to/iggredible/what-the-heck-are-cjs-amd-umd-and-esm-ikm)) | ||
```js | ||
const LocationConflation = require('@ideditor/location-conflation').default; // require default CJS | ||
const LocationConflation = require('@ideditor/location-conflation').default; // require CJS | ||
// or | ||
import LocationConflation from '@ideditor/location-conflation'; // import default ESM | ||
import LocationConflation from '@ideditor/location-conflation'; // import ESM | ||
``` | ||
@@ -64,16 +64,8 @@ | ||
You can also use **location-conflation** directly in a web browser. A good way to do this is to fetch the appropriate file from the [jsDelivr CDN](https://www.jsdelivr.com/), which can even deliver minified versions. | ||
You can also use **location-conflation** directly in a web browser. A good way to do this is to fetch the ["iife"](https://esbuild.github.io/api/#format-iife) bundle from the [jsDelivr CDN](https://www.jsdelivr.com/), which can even deliver minified versions. | ||
The latest versions of many web browsers now support [ES modules in script tags](https://caniuse.com/#feat=es6-module) like this: | ||
When you load this file in a `<script>` tag, you'll get a `LocationConflation` global to use elsewhere in your scripts: | ||
```html | ||
<script type="module"> | ||
import LocationConflation from 'https://cdn.jsdelivr.net/npm/@ideditor/location-conflation@0.9/index.mjs'; | ||
const loco = new LocationConflation(); | ||
</script> | ||
``` | ||
You can also load the IIFE build in a `<script>` tag - in this case you'll get a `LocationConflation` global to use elsewhere in your scripts: | ||
```html | ||
<head> | ||
<script src="https://cdn.jsdelivr.net/npm/@ideditor/location-conflation@0.9/dist/location-conflation.iife.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/@ideditor/location-conflation@1.0/dist/location-conflation.iife.min.js"></script> | ||
</head> | ||
@@ -80,0 +72,0 @@ … |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
1068650
8
6644
319