Comparing version 3.1.1 to 3.2.0
@@ -1,1 +0,8 @@ | ||
export {default} from './lib/utils.js' | ||
export {default} from './lib/create-utils.js' | ||
export {default as importModule} from './lib/import-module.js' | ||
export { | ||
readJson, | ||
readJson as loadJson, | ||
readJsonSync, | ||
readJsonSync as loadJsonSync, | ||
} from './lib/read-json.js' |
{ | ||
"name": "esm-utils", | ||
"version": "3.1.1", | ||
"version": "3.2.0", | ||
"description": "Utilities you'll need when migrating to ESModule.", | ||
@@ -80,3 +80,3 @@ "homepage": "https://github.com/fisker/esm-utils#readme", | ||
"prettier": "2.6.2", | ||
"sort-package-json": "1.55.0" | ||
"sort-package-json": "1.57.0" | ||
}, | ||
@@ -83,0 +83,0 @@ "packageManager": "yarn@3.2.0", |
@@ -41,2 +41,13 @@ # esm-utils | ||
```js | ||
/* Those named exports only accept absolute path or URL */ | ||
import { | ||
importModule, | ||
readJson, | ||
loadJson, | ||
readJsonSync, | ||
loadJsonSync, | ||
} from 'esm-utils' | ||
``` | ||
## API | ||
@@ -59,3 +70,3 @@ | ||
### `importModule(string | URL, options?)` | ||
### `utils.importModule(string | URL, options?)` | ||
@@ -73,7 +84,7 @@ Same as `import()`, but accepts absolute path (on Windows, `import('C:\\foo.js')` error throws when pass a absolute path starts with a drive letter). | ||
### `readJson(string | URL)` | ||
### `utils.readJson(string | URL)` | ||
Returns `Promise<jsonObject>`. | ||
### `readJsonSync(string | URL)` | ||
### `utils.readJsonSync(string | URL)` | ||
@@ -117,2 +128,14 @@ ## Import json file | ||
## `importModule()` | ||
Same as `utils.importModule()`, but only accept absolute path or URL. | ||
## `readJson()` (alias `loadJson`) | ||
Same as `utils.readJson()`, but only accept absolute path or URL. | ||
## `readJsonSync()` (alias `loadJsonSync`) | ||
Same as `utils.readJsonSync()`, but only accept absolute path or URL. | ||
## You don't need `dirname` and `filename` | ||
@@ -119,0 +142,0 @@ |
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
15016
11
245
163
1