Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kosko/require

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kosko/require - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

index.mjs

24

CHANGELOG.md
# @kosko/require
## 2.0.2
### Patch Changes
- [#79](https://github.com/tommy351/kosko/pull/79) [`3f1bc58`](https://github.com/tommy351/kosko/commit/3f1bc58dc9cc2dacfd748471e46b459c81d92c43) Thanks [@tommy351](https://github.com/tommy351)! - Add ES module wrapper. In older version of Node.js (e.g. `14.3.0`), it may be invalid to import `@kosko/require` as below.
```js
import { getRequireExtensions } from "@kosko/require";
```
It throws the following error.
```
file:///workspaces/kosko/packages/env/dist/environment/node.mjs:1
import { getRequireExtensions } from "@kosko/require";
^^^^^^^^^^^^^^^^^^^^
SyntaxError: The requested module '@kosko/require' does not provide an export named 'getRequireExtensions'
at ModuleJob._instantiate (internal/modules/esm/module_job.js:97:21)
at async ModuleJob.run (internal/modules/esm/module_job.js:135:5)
at async Loader.import (internal/modules/esm/loader.js:178:24)
```
In this release, we use an [ES module wrapper](https://nodejs.org/dist/latest-v14.x/docs/api/packages.html#packages_approach_1_use_an_es_module_wrapper) to re-export functions from the CommonJS entry point. It should fix the issue.
## 2.0.1

@@ -4,0 +28,0 @@

7

package.json
{
"name": "@kosko/require",
"version": "2.0.1",
"version": "2.0.2",
"description": "Import and resolve modules.",

@@ -10,4 +10,9 @@ "homepage": "https://kosko.dev",

"main": "index.js",
"module": "index.mjs",
"types": "index.d.ts",
"sideEffects": false,
"exports": {
"import": "./index.mjs",
"require": "./index.js"
},
"keywords": [

@@ -14,0 +19,0 @@ "kosko"

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