New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

esm-utils

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esm-utils - npm Package Compare versions

Comparing version 3.1.1 to 3.2.0

lib/create-import.js

9

index.js

@@ -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'

4

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc