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

module-from-string

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

module-from-string - npm Package Compare versions

Comparing version 2.2.2 to 2.3.0

4

__tests__/import.test.ts

@@ -18,3 +18,3 @@ import path from 'path'

const res = await importFromString(
`import { default as greet } from '${modulePath}'\nexport { greet }`
`export { default as greet } from '${modulePath}'`
)

@@ -60,3 +60,3 @@ expect(res.greet).toBe('hi')

const res = importFromStringSync(
`import { default as greet } from '${modulePath}'\nexport { greet }`
`export { default as greet } from '${modulePath}'`
)

@@ -63,0 +63,0 @@ expect(res.greet).toBe('hi')

@@ -54,4 +54,4 @@ import path from 'path'

err.stack.search(/module-from-string\/__tests__\/require\.test\.ts:50:5/)
).toBeGreaterThan(-1)
).toBeGreaterThan(0)
}
})

@@ -13,3 +13,3 @@ import { Module } from 'module';

const contextModule = new Module(nanoid());
runInNewContext(code, Object.assign({ exports: contextModule.exports, module: contextModule, require }, globals));
runInNewContext(code, Object.assign({ exports: contextModule.exports, module: contextModule, require }, globals), { microtaskMode: 'afterEvaluate' });
return contextModule.exports;

@@ -16,0 +16,0 @@ };

@@ -17,3 +17,3 @@ 'use strict';

const contextModule = new module$1.Module(nanoid.nanoid());
vm.runInNewContext(code, Object.assign({ exports: contextModule.exports, module: contextModule, require }, globals));
vm.runInNewContext(code, Object.assign({ exports: contextModule.exports, module: contextModule, require }, globals), { microtaskMode: 'afterEvaluate' });
return contextModule.exports;

@@ -20,0 +20,0 @@ };

{
"name": "module-from-string",
"version": "2.2.2",
"version": "2.3.0",
"description": "Load module from string, require and import.",

@@ -41,17 +41,17 @@ "main": "dist/index.js",

"dependencies": {
"esbuild": "0.10.2",
"nanoid": "3.1.22"
"esbuild": "0.12.15",
"nanoid": "3.1.23"
},
"devDependencies": {
"@rollup/plugin-typescript": "8.2.1",
"@types/jest": "26.0.22",
"@types/node": "14.14.37",
"jest": "26.6.3",
"rollup": "2.43.0",
"rollup-plugin-dts": "3.0.1",
"ts-jest": "26.5.4",
"ts-standardx": "0.7.4",
"tslib": "2.1.0",
"typescript": "4.2.3"
"@types/jest": "26.0.24",
"@types/node": "16.0.1",
"jest": "27.0.6",
"rollup": "2.52.8",
"rollup-plugin-dts": "3.0.2",
"ts-jest": "27.0.3",
"ts-standardx": "0.7.6",
"tslib": "2.3.0",
"typescript": "4.3.5"
}
}
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