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

js-runtime

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-runtime - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

22

package.json
{
"name": "js-runtime",
"version": "0.0.3",
"version": "0.0.4",
"description": "Detect which JavaScript runtime is being used.",

@@ -35,14 +35,14 @@ "keywords": [

"devDependencies": {
"@eslint/js": "^8.44.0",
"@types/eslint": "~8.40.2",
"@types/node": "^20.3.3",
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "~5.61.0",
"bun-types": "^0.6.12",
"eslint-config-prettier": "~8.8.0",
"@eslint/js": "^8.46.0",
"@types/eslint": "~8.44.2",
"@types/node": "^20.4.9",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "~6.3.0",
"bun-types": "^0.7.3",
"eslint-config-prettier": "~9.0.0",
"eslint-formatter-pretty": "^5.0.0",
"eslint-plugin-eslint-plugin": "^5.1.0",
"eslint-plugin-eslint-plugin": "^5.1.1",
"globals": "^13.20.0",
"prettier": "^2.8.8",
"tsup": "^7.1.0",
"prettier": "^3.0.1",
"tsup": "^7.2.0",
"typescript": "^5.1.6"

@@ -49,0 +49,0 @@ },

@@ -27,5 +27,5 @@ <div align="center">

```javascript
import { getRuntime } from "js-runtime";
import { get } from "js-runtime";
console.log(getRuntime()); //node or deno or bun
console.log(get()); //node or deno or bun
```

@@ -41,3 +41,3 @@

### getRuntime
### get

@@ -65,3 +65,3 @@ Return the current runtime.

### getRuntimeVersion
### getVersion

@@ -74,3 +74,3 @@ Retrieve the version used in the current runtime.

### runtimeSwitch
### switcher

@@ -85,5 +85,5 @@ Switch based on the current runtime.

```typescript
import { runtimeSwitch } from "js-runtime";
import { switcher } from "js-runtime";
const message = runtimeSwitch({
const message = switcher({
bun: "Script is running with Bun",

@@ -102,5 +102,5 @@ deno: "Script is running with Deno",

### runtimeImport
### importer
Dynamic import based on switch data, see runtimeSwitch.
Dynamic import based on switch data, see switcher.

@@ -113,5 +113,5 @@ Type: `function`\

```typescript
import { runtimeImport } from "js-runtime";
import { importer } from "js-runtime";
const SQLite = await runtimeImport({
const SQLite = await importer({
bun: "bun:sqlite",

@@ -118,0 +118,0 @@ deno: "https://deno.land/x/sqlite3@0.9.1/mod.ts",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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