Skip to content

Support ES Module: import fs from 'njs:fs'; #828

Open
@PassionPI

Description

It's possible to import the njs module like this?

import fs from 'njs:fs';
or
import fs from 'nginx:fs';

Describe the solution you'd like

Import all modules that are not web standards but are supported by Nginx.

import fs from 'njs:fs';
import zlib from 'njs:zlib';
...

Describe alternatives you've considered

In other JS runtimes, it is common to import modules using specific prefixes, for example, import path from "node:path".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions