2.12.1 • Published 1 year ago

@reejs/imports v2.12.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Using Ree.js Import Helpers

Install the package:

npm i @reejs/imports

Importing

import { dynamicImport, NativeImport, URLImport } from "@reejs/imports";
let fs = await NativeImport("node:fs");
let React = await URLImport("https://esm.sh/react?target=node&bundle");
//use them in your project!

Fixing the problems with a normal dynamic import

Did you realise there's a new variable called default in a dynamically imported module via await import? You can make that imported module act as if it was imported statically by this way:

let path = dynamicImport(await import("node:path"));
//use path as if it was imported as: import path from "node:path"

Please note: NativeImport & URLImport functions uses dynamicImport under the hood to improve your DX.

You can even use this package in Deno as we provide full runtime compability (till an extent it's possible, for instance, we can't provide support for Deno.http as no polyfills are created for Nodejs)

Supported Runtimes:

  • Nodejs
  • Deno
  • Bun
  • Browser (native imports currently not supported)

Found or having any problems? Head over to our repository at https://github.com/rovelstars/reejs or discuss with us over discord at: https://dscrdly.com/server

2.12.0

1 year ago

2.12.1

1 year ago

2.9.0

1 year ago

2.6.1

2 years ago

2.6.0

2 years ago

2.8.1

2 years ago

2.8.0

2 years ago

2.7.4

2 years ago

2.7.3

2 years ago

2.7.5

2 years ago

2.2.28

2 years ago

2.2.29

2 years ago

2.2.26

2 years ago

2.2.27

2 years ago

2.3.35

2 years ago

2.3.34

2 years ago

2.2.25

2 years ago

2.3.31

2 years ago

2.3.33

2 years ago

2.3.32

2 years ago

2.7.0

2 years ago

2.5.2

2 years ago

2.1.23

2 years ago

2.5.1

2 years ago

2.1.24

2 years ago

2.7.2

2 years ago

2.5.4

2 years ago

2.7.1

2 years ago

2.5.3

2 years ago

2.2.31

2 years ago

2.2.30

2 years ago

2.8.3

2 years ago

2.8.2

2 years ago

2.1.18

2 years ago

2.1.19

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.4

2 years ago

2.1.3

2 years ago

2.1.6

2 years ago

2.1.5

2 years ago

2.1.21

2 years ago

2.1.8

2 years ago

2.1.22

2 years ago

2.1.7

2 years ago

2.1.20

2 years ago

2.1.0

2 years ago

2.1.9

2 years ago

2.1.16

2 years ago

2.1.15

2 years ago

2.1.12

2 years ago

2.1.13

2 years ago

2.1.10

2 years ago

2.1.11

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.9

2 years ago

2.0.8

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago