@suchipi/quickjs 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/build/aarch64-apple-darwin/bin/qjs +0 -0
- package/build/aarch64-apple-darwin/bin/qjsbootstrap +0 -0
- package/build/aarch64-apple-darwin/bin/qjsbootstrap-bytecode +0 -0
- package/build/aarch64-apple-darwin/bin/qjsc +0 -0
- package/build/aarch64-apple-darwin/bin/quickjs-run +0 -0
- package/build/aarch64-apple-darwin/dts/quickjs-libc.d.ts +46 -0
- package/build/aarch64-apple-darwin/dts/quickjs-libpointer.d.ts +14 -0
- package/build/aarch64-apple-darwin/lib/quickjs-core.a +0 -0
- package/build/aarch64-apple-darwin/lib/quickjs-full.a +0 -0
- package/build/aarch64-unknown-linux-gnu/bin/qjs +0 -0
- package/build/aarch64-unknown-linux-gnu/bin/qjsbootstrap +0 -0
- package/build/aarch64-unknown-linux-gnu/bin/qjsbootstrap-bytecode +0 -0
- package/build/aarch64-unknown-linux-gnu/bin/qjsc +0 -0
- package/build/aarch64-unknown-linux-gnu/bin/quickjs-run +0 -0
- package/build/aarch64-unknown-linux-gnu/dts/quickjs-libc.d.ts +46 -0
- package/build/aarch64-unknown-linux-gnu/dts/quickjs-libpointer.d.ts +14 -0
- package/build/aarch64-unknown-linux-gnu/lib/quickjs-core.a +0 -0
- package/build/aarch64-unknown-linux-gnu/lib/quickjs-full.a +0 -0
- package/build/aarch64-unknown-linux-musl/bin/qjs +0 -0
- package/build/aarch64-unknown-linux-musl/bin/qjsbootstrap +0 -0
- package/build/aarch64-unknown-linux-musl/bin/qjsbootstrap-bytecode +0 -0
- package/build/aarch64-unknown-linux-musl/bin/qjsc +0 -0
- package/build/aarch64-unknown-linux-musl/bin/quickjs-run +0 -0
- package/build/aarch64-unknown-linux-musl/dts/quickjs-libc.d.ts +46 -0
- package/build/aarch64-unknown-linux-musl/dts/quickjs-libpointer.d.ts +14 -0
- package/build/aarch64-unknown-linux-musl/lib/quickjs-core.a +0 -0
- package/build/aarch64-unknown-linux-musl/lib/quickjs-full.a +0 -0
- package/build/aarch64-unknown-linux-static/bin/qjs +0 -0
- package/build/aarch64-unknown-linux-static/bin/qjsbootstrap +0 -0
- package/build/aarch64-unknown-linux-static/bin/qjsbootstrap-bytecode +0 -0
- package/build/aarch64-unknown-linux-static/bin/qjsc +0 -0
- package/build/aarch64-unknown-linux-static/bin/quickjs-run +0 -0
- package/build/aarch64-unknown-linux-static/dts/quickjs-libc.d.ts +46 -0
- package/build/aarch64-unknown-linux-static/dts/quickjs-libpointer.d.ts +14 -0
- package/build/aarch64-unknown-linux-static/lib/quickjs-core.a +0 -0
- package/build/aarch64-unknown-linux-static/lib/quickjs-full.a +0 -0
- package/build/x86_64-apple-darwin/bin/qjs +0 -0
- package/build/x86_64-apple-darwin/bin/qjsbootstrap +0 -0
- package/build/x86_64-apple-darwin/bin/qjsbootstrap-bytecode +0 -0
- package/build/x86_64-apple-darwin/bin/qjsc +0 -0
- package/build/x86_64-apple-darwin/bin/quickjs-run +0 -0
- package/build/x86_64-apple-darwin/dts/quickjs-libc.d.ts +46 -0
- package/build/x86_64-apple-darwin/dts/quickjs-libpointer.d.ts +14 -0
- package/build/x86_64-apple-darwin/lib/quickjs-core.a +0 -0
- package/build/x86_64-apple-darwin/lib/quickjs-full.a +0 -0
- package/build/x86_64-pc-windows-static/bin/qjs.exe +0 -0
- package/build/x86_64-pc-windows-static/bin/qjsbootstrap-bytecode.exe +0 -0
- package/build/x86_64-pc-windows-static/bin/qjsbootstrap.exe +0 -0
- package/build/x86_64-pc-windows-static/bin/qjsc.exe +0 -0
- package/build/x86_64-pc-windows-static/bin/quickjs-run.exe +0 -0
- package/build/x86_64-pc-windows-static/dts/quickjs-libc.d.ts +46 -0
- package/build/x86_64-pc-windows-static/dts/quickjs-libpointer.d.ts +14 -0
- package/build/x86_64-pc-windows-static/lib/quickjs-core.a +0 -0
- package/build/x86_64-pc-windows-static/lib/quickjs-full.a +0 -0
- package/build/x86_64-unknown-linux-gnu/bin/qjs +0 -0
- package/build/x86_64-unknown-linux-gnu/bin/qjsbootstrap +0 -0
- package/build/x86_64-unknown-linux-gnu/bin/qjsbootstrap-bytecode +0 -0
- package/build/x86_64-unknown-linux-gnu/bin/qjsc +0 -0
- package/build/x86_64-unknown-linux-gnu/bin/quickjs-run +0 -0
- package/build/x86_64-unknown-linux-gnu/dts/quickjs-libc.d.ts +46 -0
- package/build/x86_64-unknown-linux-gnu/dts/quickjs-libpointer.d.ts +14 -0
- package/build/x86_64-unknown-linux-gnu/lib/quickjs-core.a +0 -0
- package/build/x86_64-unknown-linux-gnu/lib/quickjs-full.a +0 -0
- package/build/x86_64-unknown-linux-musl/bin/qjs +0 -0
- package/build/x86_64-unknown-linux-musl/bin/qjsbootstrap +0 -0
- package/build/x86_64-unknown-linux-musl/bin/qjsbootstrap-bytecode +0 -0
- package/build/x86_64-unknown-linux-musl/bin/qjsc +0 -0
- package/build/x86_64-unknown-linux-musl/bin/quickjs-run +0 -0
- package/build/x86_64-unknown-linux-musl/dts/quickjs-libc.d.ts +46 -0
- package/build/x86_64-unknown-linux-musl/dts/quickjs-libpointer.d.ts +14 -0
- package/build/x86_64-unknown-linux-musl/lib/quickjs-core.a +0 -0
- package/build/x86_64-unknown-linux-musl/lib/quickjs-full.a +0 -0
- package/build/x86_64-unknown-linux-static/bin/qjs +0 -0
- package/build/x86_64-unknown-linux-static/bin/qjsbootstrap +0 -0
- package/build/x86_64-unknown-linux-static/bin/qjsbootstrap-bytecode +0 -0
- package/build/x86_64-unknown-linux-static/bin/qjsc +0 -0
- package/build/x86_64-unknown-linux-static/bin/quickjs-run +0 -0
- package/build/x86_64-unknown-linux-static/dts/quickjs-libc.d.ts +46 -0
- package/build/x86_64-unknown-linux-static/dts/quickjs-libpointer.d.ts +14 -0
- package/build/x86_64-unknown-linux-static/lib/quickjs-core.a +0 -0
- package/build/x86_64-unknown-linux-static/lib/quickjs-full.a +0 -0
- package/npm/index.js +0 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -56,10 +56,12 @@ Fork of the fantastic QuickJS engine by Fabrice Bellard, with the following chan
|
|
|
56
56
|
- `os.{WUNTRACED,WEXITSTATUS,WTERMSIG,WSTOPSIG,WIFEXITED,WIFSIGNALED,WIFSTOPPED,WIFCONTINUED}` added, for working with `os.waitpid`.
|
|
57
57
|
- `os.{S_IRWXU,S_IRUSR,S_IWUSR,S_IXUSR,S_IRWXG,S_IRGRP,S_IWGRP,S_IXGRP,S_IRWXO,S_IROTH,S_IWOTH,S_IXOTH}` added, for working with file modes.
|
|
58
58
|
- `"b"` mode flag is now allowed in `std.fdopen`.
|
|
59
|
+
- `std.strftime` is now available (wrapper for libc `strftime`).
|
|
59
60
|
- `setTimeout` and `clearTimeout` are now available as globals.
|
|
60
61
|
- `setInterval` and `clearInterval` are now available as globals.
|
|
61
62
|
- `String.cooked` is now available (no-op template tag, like the proposed [String.cooked](https://github.com/tc39/proposal-string-cooked)).
|
|
62
63
|
- `String.dedent` is now available (template tag function, like the proposed [String.dedent](https://github.com/tc39/proposal-string-dedent)).
|
|
64
|
+
- Added `std.getuid`, `std.geteuid`, `std.getgid`, and `std.getegid` (wrappers for the libc functions of the same names).
|
|
63
65
|
|
|
64
66
|
## Changes to the `qjs` repl:
|
|
65
67
|
|
|
@@ -67,6 +69,7 @@ Fork of the fantastic QuickJS engine by Fabrice Bellard, with the following chan
|
|
|
67
69
|
- The last error is accessible via the `_error` global
|
|
68
70
|
- If a thrown error has additional properties added onto it, those are printed along with the thrown error
|
|
69
71
|
- Ctrl+W deletes words backwards from the cursor position
|
|
72
|
+
- Blocking the main thread is allowed
|
|
70
73
|
|
|
71
74
|
## New binary: `qjsbootstrap`:
|
|
72
75
|
|
|
@@ -83,6 +86,10 @@ You can use this to create distributable binaries that run JS code without needi
|
|
|
83
86
|
|
|
84
87
|
> Note: On FreeBSD, `qjsbootstrap` requires procfs. You can mount it with `mount -t procfs proc /proc`. I started some work to use libprocstat instead, but haven't completed it yet.
|
|
85
88
|
|
|
89
|
+
## New binary: `quickjs-run`:
|
|
90
|
+
|
|
91
|
+
Barebones binary for running files, without any of the arg parsing logic from qjs. Good for testing some unusual cases, or writing programs with custom argv parsing logic.
|
|
92
|
+
|
|
86
93
|
## New module: "quickjs:bytecode"
|
|
87
94
|
|
|
88
95
|
A Module that exposes QuickJS's value <-> bytecode (de)serialization APIs to JavaScript code. Generated bytecode can be combined with `qjsbootstrap-bytecode` in the same way that source code strings can be combined with `qjsbootstrap`.
|
|
@@ -91,6 +98,10 @@ A Module that exposes QuickJS's value <-> bytecode (de)serialization APIs to Jav
|
|
|
91
98
|
|
|
92
99
|
A Module that allows JS code to create new JS Contexts (Realms). You can create new Contexts and run code inside them. Contexts can have certain features disabled (like eval) for security purposes. You can share values between Contexts. Contexts are destroyed when they get garbage-collected.
|
|
93
100
|
|
|
101
|
+
## New module: "quickjs:pointer"
|
|
102
|
+
|
|
103
|
+
A barebones Module that exports a JS class which can be used to represent an opaque pointer. C modules can use the `js_new_pointer` function provided by this module to pass opaque pointer handles to users without needing to make their own wrapper class for stuff. This is mostly just useful in order to have a codified convention for how FFI libraries and such should represent foreign pointers.
|
|
104
|
+
|
|
94
105
|
## New library: `quickjs-utils`
|
|
95
106
|
|
|
96
107
|
Helper structs, functions, and macros that make it easier to work with QuickJS objects in C code.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -293,6 +293,38 @@ declare module "quickjs:std" {
|
|
|
293
293
|
/** Return an object containing the environment variables as key-value pairs. */
|
|
294
294
|
export function getenviron(): { [key: string]: string | undefined };
|
|
295
295
|
|
|
296
|
+
/**
|
|
297
|
+
* Return the real user ID of the calling process.
|
|
298
|
+
*
|
|
299
|
+
* This function throws an error on windows, because windows doesn't support
|
|
300
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
301
|
+
*/
|
|
302
|
+
export function getuid(): number;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Return the effective user ID of the calling process.
|
|
306
|
+
*
|
|
307
|
+
* This function throws an error on windows, because windows doesn't support
|
|
308
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
309
|
+
*/
|
|
310
|
+
export function geteuid(): number;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Return the real group ID of the calling process.
|
|
314
|
+
*
|
|
315
|
+
* This function throws an error on windows, because windows doesn't support
|
|
316
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
317
|
+
*/
|
|
318
|
+
export function getgid(): number;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Return the effective group ID of the calling process.
|
|
322
|
+
*
|
|
323
|
+
* This function throws an error on windows, because windows doesn't support
|
|
324
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
325
|
+
*/
|
|
326
|
+
export function getegid(): number;
|
|
327
|
+
|
|
296
328
|
interface UrlGet {
|
|
297
329
|
/**
|
|
298
330
|
* Download `url` using the `curl` command line utility. Returns string
|
|
@@ -410,6 +442,20 @@ declare module "quickjs:std" {
|
|
|
410
442
|
* - octal (0o prefix) and hexadecimal (0x prefix) numbers
|
|
411
443
|
*/
|
|
412
444
|
export function parseExtJSON(str: string): any;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* A wrapper around the standard C [strftime](https://en.cppreference.com/w/c/chrono/strftime).
|
|
448
|
+
* Formats a time/date into a format as specified by the user.
|
|
449
|
+
*
|
|
450
|
+
* @param maxBytes - The number of bytes to allocate for the string that will be returned
|
|
451
|
+
* @param format - Format string, using `%`-prefixed sequences as found in [this table](https://en.cppreference.com/w/c/chrono/strftime#Format_string).
|
|
452
|
+
* @param time - The Date object (or unix timestamp, in ms) to render.
|
|
453
|
+
*/
|
|
454
|
+
export function strftime(
|
|
455
|
+
maxBytes: number,
|
|
456
|
+
format: string,
|
|
457
|
+
time: Date | number
|
|
458
|
+
): string;
|
|
413
459
|
}
|
|
414
460
|
|
|
415
461
|
declare module "quickjs:os" {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare module "quickjs:pointer" {
|
|
2
|
+
/**
|
|
3
|
+
* An opaque pointer value which can be passed around by JS
|
|
4
|
+
*/
|
|
5
|
+
export class Pointer {
|
|
6
|
+
static NULL: Pointer;
|
|
7
|
+
|
|
8
|
+
/** Returns a boolean indicating whether the provided value is a `Pointer` object. */
|
|
9
|
+
static isPointer(value: any): boolean;
|
|
10
|
+
|
|
11
|
+
/** For debug logging purposes only; format can vary from platform to platform and is not guaranteed to be present or consistent. */
|
|
12
|
+
_info?: string;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -293,6 +293,38 @@ declare module "quickjs:std" {
|
|
|
293
293
|
/** Return an object containing the environment variables as key-value pairs. */
|
|
294
294
|
export function getenviron(): { [key: string]: string | undefined };
|
|
295
295
|
|
|
296
|
+
/**
|
|
297
|
+
* Return the real user ID of the calling process.
|
|
298
|
+
*
|
|
299
|
+
* This function throws an error on windows, because windows doesn't support
|
|
300
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
301
|
+
*/
|
|
302
|
+
export function getuid(): number;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Return the effective user ID of the calling process.
|
|
306
|
+
*
|
|
307
|
+
* This function throws an error on windows, because windows doesn't support
|
|
308
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
309
|
+
*/
|
|
310
|
+
export function geteuid(): number;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Return the real group ID of the calling process.
|
|
314
|
+
*
|
|
315
|
+
* This function throws an error on windows, because windows doesn't support
|
|
316
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
317
|
+
*/
|
|
318
|
+
export function getgid(): number;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Return the effective group ID of the calling process.
|
|
322
|
+
*
|
|
323
|
+
* This function throws an error on windows, because windows doesn't support
|
|
324
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
325
|
+
*/
|
|
326
|
+
export function getegid(): number;
|
|
327
|
+
|
|
296
328
|
interface UrlGet {
|
|
297
329
|
/**
|
|
298
330
|
* Download `url` using the `curl` command line utility. Returns string
|
|
@@ -410,6 +442,20 @@ declare module "quickjs:std" {
|
|
|
410
442
|
* - octal (0o prefix) and hexadecimal (0x prefix) numbers
|
|
411
443
|
*/
|
|
412
444
|
export function parseExtJSON(str: string): any;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* A wrapper around the standard C [strftime](https://en.cppreference.com/w/c/chrono/strftime).
|
|
448
|
+
* Formats a time/date into a format as specified by the user.
|
|
449
|
+
*
|
|
450
|
+
* @param maxBytes - The number of bytes to allocate for the string that will be returned
|
|
451
|
+
* @param format - Format string, using `%`-prefixed sequences as found in [this table](https://en.cppreference.com/w/c/chrono/strftime#Format_string).
|
|
452
|
+
* @param time - The Date object (or unix timestamp, in ms) to render.
|
|
453
|
+
*/
|
|
454
|
+
export function strftime(
|
|
455
|
+
maxBytes: number,
|
|
456
|
+
format: string,
|
|
457
|
+
time: Date | number
|
|
458
|
+
): string;
|
|
413
459
|
}
|
|
414
460
|
|
|
415
461
|
declare module "quickjs:os" {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare module "quickjs:pointer" {
|
|
2
|
+
/**
|
|
3
|
+
* An opaque pointer value which can be passed around by JS
|
|
4
|
+
*/
|
|
5
|
+
export class Pointer {
|
|
6
|
+
static NULL: Pointer;
|
|
7
|
+
|
|
8
|
+
/** Returns a boolean indicating whether the provided value is a `Pointer` object. */
|
|
9
|
+
static isPointer(value: any): boolean;
|
|
10
|
+
|
|
11
|
+
/** For debug logging purposes only; format can vary from platform to platform and is not guaranteed to be present or consistent. */
|
|
12
|
+
_info?: string;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -293,6 +293,38 @@ declare module "quickjs:std" {
|
|
|
293
293
|
/** Return an object containing the environment variables as key-value pairs. */
|
|
294
294
|
export function getenviron(): { [key: string]: string | undefined };
|
|
295
295
|
|
|
296
|
+
/**
|
|
297
|
+
* Return the real user ID of the calling process.
|
|
298
|
+
*
|
|
299
|
+
* This function throws an error on windows, because windows doesn't support
|
|
300
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
301
|
+
*/
|
|
302
|
+
export function getuid(): number;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Return the effective user ID of the calling process.
|
|
306
|
+
*
|
|
307
|
+
* This function throws an error on windows, because windows doesn't support
|
|
308
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
309
|
+
*/
|
|
310
|
+
export function geteuid(): number;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Return the real group ID of the calling process.
|
|
314
|
+
*
|
|
315
|
+
* This function throws an error on windows, because windows doesn't support
|
|
316
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
317
|
+
*/
|
|
318
|
+
export function getgid(): number;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Return the effective group ID of the calling process.
|
|
322
|
+
*
|
|
323
|
+
* This function throws an error on windows, because windows doesn't support
|
|
324
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
325
|
+
*/
|
|
326
|
+
export function getegid(): number;
|
|
327
|
+
|
|
296
328
|
interface UrlGet {
|
|
297
329
|
/**
|
|
298
330
|
* Download `url` using the `curl` command line utility. Returns string
|
|
@@ -410,6 +442,20 @@ declare module "quickjs:std" {
|
|
|
410
442
|
* - octal (0o prefix) and hexadecimal (0x prefix) numbers
|
|
411
443
|
*/
|
|
412
444
|
export function parseExtJSON(str: string): any;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* A wrapper around the standard C [strftime](https://en.cppreference.com/w/c/chrono/strftime).
|
|
448
|
+
* Formats a time/date into a format as specified by the user.
|
|
449
|
+
*
|
|
450
|
+
* @param maxBytes - The number of bytes to allocate for the string that will be returned
|
|
451
|
+
* @param format - Format string, using `%`-prefixed sequences as found in [this table](https://en.cppreference.com/w/c/chrono/strftime#Format_string).
|
|
452
|
+
* @param time - The Date object (or unix timestamp, in ms) to render.
|
|
453
|
+
*/
|
|
454
|
+
export function strftime(
|
|
455
|
+
maxBytes: number,
|
|
456
|
+
format: string,
|
|
457
|
+
time: Date | number
|
|
458
|
+
): string;
|
|
413
459
|
}
|
|
414
460
|
|
|
415
461
|
declare module "quickjs:os" {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare module "quickjs:pointer" {
|
|
2
|
+
/**
|
|
3
|
+
* An opaque pointer value which can be passed around by JS
|
|
4
|
+
*/
|
|
5
|
+
export class Pointer {
|
|
6
|
+
static NULL: Pointer;
|
|
7
|
+
|
|
8
|
+
/** Returns a boolean indicating whether the provided value is a `Pointer` object. */
|
|
9
|
+
static isPointer(value: any): boolean;
|
|
10
|
+
|
|
11
|
+
/** For debug logging purposes only; format can vary from platform to platform and is not guaranteed to be present or consistent. */
|
|
12
|
+
_info?: string;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -293,6 +293,38 @@ declare module "quickjs:std" {
|
|
|
293
293
|
/** Return an object containing the environment variables as key-value pairs. */
|
|
294
294
|
export function getenviron(): { [key: string]: string | undefined };
|
|
295
295
|
|
|
296
|
+
/**
|
|
297
|
+
* Return the real user ID of the calling process.
|
|
298
|
+
*
|
|
299
|
+
* This function throws an error on windows, because windows doesn't support
|
|
300
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
301
|
+
*/
|
|
302
|
+
export function getuid(): number;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Return the effective user ID of the calling process.
|
|
306
|
+
*
|
|
307
|
+
* This function throws an error on windows, because windows doesn't support
|
|
308
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
309
|
+
*/
|
|
310
|
+
export function geteuid(): number;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Return the real group ID of the calling process.
|
|
314
|
+
*
|
|
315
|
+
* This function throws an error on windows, because windows doesn't support
|
|
316
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
317
|
+
*/
|
|
318
|
+
export function getgid(): number;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Return the effective group ID of the calling process.
|
|
322
|
+
*
|
|
323
|
+
* This function throws an error on windows, because windows doesn't support
|
|
324
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
325
|
+
*/
|
|
326
|
+
export function getegid(): number;
|
|
327
|
+
|
|
296
328
|
interface UrlGet {
|
|
297
329
|
/**
|
|
298
330
|
* Download `url` using the `curl` command line utility. Returns string
|
|
@@ -410,6 +442,20 @@ declare module "quickjs:std" {
|
|
|
410
442
|
* - octal (0o prefix) and hexadecimal (0x prefix) numbers
|
|
411
443
|
*/
|
|
412
444
|
export function parseExtJSON(str: string): any;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* A wrapper around the standard C [strftime](https://en.cppreference.com/w/c/chrono/strftime).
|
|
448
|
+
* Formats a time/date into a format as specified by the user.
|
|
449
|
+
*
|
|
450
|
+
* @param maxBytes - The number of bytes to allocate for the string that will be returned
|
|
451
|
+
* @param format - Format string, using `%`-prefixed sequences as found in [this table](https://en.cppreference.com/w/c/chrono/strftime#Format_string).
|
|
452
|
+
* @param time - The Date object (or unix timestamp, in ms) to render.
|
|
453
|
+
*/
|
|
454
|
+
export function strftime(
|
|
455
|
+
maxBytes: number,
|
|
456
|
+
format: string,
|
|
457
|
+
time: Date | number
|
|
458
|
+
): string;
|
|
413
459
|
}
|
|
414
460
|
|
|
415
461
|
declare module "quickjs:os" {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare module "quickjs:pointer" {
|
|
2
|
+
/**
|
|
3
|
+
* An opaque pointer value which can be passed around by JS
|
|
4
|
+
*/
|
|
5
|
+
export class Pointer {
|
|
6
|
+
static NULL: Pointer;
|
|
7
|
+
|
|
8
|
+
/** Returns a boolean indicating whether the provided value is a `Pointer` object. */
|
|
9
|
+
static isPointer(value: any): boolean;
|
|
10
|
+
|
|
11
|
+
/** For debug logging purposes only; format can vary from platform to platform and is not guaranteed to be present or consistent. */
|
|
12
|
+
_info?: string;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -293,6 +293,38 @@ declare module "quickjs:std" {
|
|
|
293
293
|
/** Return an object containing the environment variables as key-value pairs. */
|
|
294
294
|
export function getenviron(): { [key: string]: string | undefined };
|
|
295
295
|
|
|
296
|
+
/**
|
|
297
|
+
* Return the real user ID of the calling process.
|
|
298
|
+
*
|
|
299
|
+
* This function throws an error on windows, because windows doesn't support
|
|
300
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
301
|
+
*/
|
|
302
|
+
export function getuid(): number;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Return the effective user ID of the calling process.
|
|
306
|
+
*
|
|
307
|
+
* This function throws an error on windows, because windows doesn't support
|
|
308
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
309
|
+
*/
|
|
310
|
+
export function geteuid(): number;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Return the real group ID of the calling process.
|
|
314
|
+
*
|
|
315
|
+
* This function throws an error on windows, because windows doesn't support
|
|
316
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
317
|
+
*/
|
|
318
|
+
export function getgid(): number;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Return the effective group ID of the calling process.
|
|
322
|
+
*
|
|
323
|
+
* This function throws an error on windows, because windows doesn't support
|
|
324
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
325
|
+
*/
|
|
326
|
+
export function getegid(): number;
|
|
327
|
+
|
|
296
328
|
interface UrlGet {
|
|
297
329
|
/**
|
|
298
330
|
* Download `url` using the `curl` command line utility. Returns string
|
|
@@ -410,6 +442,20 @@ declare module "quickjs:std" {
|
|
|
410
442
|
* - octal (0o prefix) and hexadecimal (0x prefix) numbers
|
|
411
443
|
*/
|
|
412
444
|
export function parseExtJSON(str: string): any;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* A wrapper around the standard C [strftime](https://en.cppreference.com/w/c/chrono/strftime).
|
|
448
|
+
* Formats a time/date into a format as specified by the user.
|
|
449
|
+
*
|
|
450
|
+
* @param maxBytes - The number of bytes to allocate for the string that will be returned
|
|
451
|
+
* @param format - Format string, using `%`-prefixed sequences as found in [this table](https://en.cppreference.com/w/c/chrono/strftime#Format_string).
|
|
452
|
+
* @param time - The Date object (or unix timestamp, in ms) to render.
|
|
453
|
+
*/
|
|
454
|
+
export function strftime(
|
|
455
|
+
maxBytes: number,
|
|
456
|
+
format: string,
|
|
457
|
+
time: Date | number
|
|
458
|
+
): string;
|
|
413
459
|
}
|
|
414
460
|
|
|
415
461
|
declare module "quickjs:os" {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare module "quickjs:pointer" {
|
|
2
|
+
/**
|
|
3
|
+
* An opaque pointer value which can be passed around by JS
|
|
4
|
+
*/
|
|
5
|
+
export class Pointer {
|
|
6
|
+
static NULL: Pointer;
|
|
7
|
+
|
|
8
|
+
/** Returns a boolean indicating whether the provided value is a `Pointer` object. */
|
|
9
|
+
static isPointer(value: any): boolean;
|
|
10
|
+
|
|
11
|
+
/** For debug logging purposes only; format can vary from platform to platform and is not guaranteed to be present or consistent. */
|
|
12
|
+
_info?: string;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -293,6 +293,38 @@ declare module "quickjs:std" {
|
|
|
293
293
|
/** Return an object containing the environment variables as key-value pairs. */
|
|
294
294
|
export function getenviron(): { [key: string]: string | undefined };
|
|
295
295
|
|
|
296
|
+
/**
|
|
297
|
+
* Return the real user ID of the calling process.
|
|
298
|
+
*
|
|
299
|
+
* This function throws an error on windows, because windows doesn't support
|
|
300
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
301
|
+
*/
|
|
302
|
+
export function getuid(): number;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Return the effective user ID of the calling process.
|
|
306
|
+
*
|
|
307
|
+
* This function throws an error on windows, because windows doesn't support
|
|
308
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
309
|
+
*/
|
|
310
|
+
export function geteuid(): number;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Return the real group ID of the calling process.
|
|
314
|
+
*
|
|
315
|
+
* This function throws an error on windows, because windows doesn't support
|
|
316
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
317
|
+
*/
|
|
318
|
+
export function getgid(): number;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Return the effective group ID of the calling process.
|
|
322
|
+
*
|
|
323
|
+
* This function throws an error on windows, because windows doesn't support
|
|
324
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
325
|
+
*/
|
|
326
|
+
export function getegid(): number;
|
|
327
|
+
|
|
296
328
|
interface UrlGet {
|
|
297
329
|
/**
|
|
298
330
|
* Download `url` using the `curl` command line utility. Returns string
|
|
@@ -410,6 +442,20 @@ declare module "quickjs:std" {
|
|
|
410
442
|
* - octal (0o prefix) and hexadecimal (0x prefix) numbers
|
|
411
443
|
*/
|
|
412
444
|
export function parseExtJSON(str: string): any;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* A wrapper around the standard C [strftime](https://en.cppreference.com/w/c/chrono/strftime).
|
|
448
|
+
* Formats a time/date into a format as specified by the user.
|
|
449
|
+
*
|
|
450
|
+
* @param maxBytes - The number of bytes to allocate for the string that will be returned
|
|
451
|
+
* @param format - Format string, using `%`-prefixed sequences as found in [this table](https://en.cppreference.com/w/c/chrono/strftime#Format_string).
|
|
452
|
+
* @param time - The Date object (or unix timestamp, in ms) to render.
|
|
453
|
+
*/
|
|
454
|
+
export function strftime(
|
|
455
|
+
maxBytes: number,
|
|
456
|
+
format: string,
|
|
457
|
+
time: Date | number
|
|
458
|
+
): string;
|
|
413
459
|
}
|
|
414
460
|
|
|
415
461
|
declare module "quickjs:os" {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare module "quickjs:pointer" {
|
|
2
|
+
/**
|
|
3
|
+
* An opaque pointer value which can be passed around by JS
|
|
4
|
+
*/
|
|
5
|
+
export class Pointer {
|
|
6
|
+
static NULL: Pointer;
|
|
7
|
+
|
|
8
|
+
/** Returns a boolean indicating whether the provided value is a `Pointer` object. */
|
|
9
|
+
static isPointer(value: any): boolean;
|
|
10
|
+
|
|
11
|
+
/** For debug logging purposes only; format can vary from platform to platform and is not guaranteed to be present or consistent. */
|
|
12
|
+
_info?: string;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -293,6 +293,38 @@ declare module "quickjs:std" {
|
|
|
293
293
|
/** Return an object containing the environment variables as key-value pairs. */
|
|
294
294
|
export function getenviron(): { [key: string]: string | undefined };
|
|
295
295
|
|
|
296
|
+
/**
|
|
297
|
+
* Return the real user ID of the calling process.
|
|
298
|
+
*
|
|
299
|
+
* This function throws an error on windows, because windows doesn't support
|
|
300
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
301
|
+
*/
|
|
302
|
+
export function getuid(): number;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Return the effective user ID of the calling process.
|
|
306
|
+
*
|
|
307
|
+
* This function throws an error on windows, because windows doesn't support
|
|
308
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
309
|
+
*/
|
|
310
|
+
export function geteuid(): number;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Return the real group ID of the calling process.
|
|
314
|
+
*
|
|
315
|
+
* This function throws an error on windows, because windows doesn't support
|
|
316
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
317
|
+
*/
|
|
318
|
+
export function getgid(): number;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Return the effective group ID of the calling process.
|
|
322
|
+
*
|
|
323
|
+
* This function throws an error on windows, because windows doesn't support
|
|
324
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
325
|
+
*/
|
|
326
|
+
export function getegid(): number;
|
|
327
|
+
|
|
296
328
|
interface UrlGet {
|
|
297
329
|
/**
|
|
298
330
|
* Download `url` using the `curl` command line utility. Returns string
|
|
@@ -410,6 +442,20 @@ declare module "quickjs:std" {
|
|
|
410
442
|
* - octal (0o prefix) and hexadecimal (0x prefix) numbers
|
|
411
443
|
*/
|
|
412
444
|
export function parseExtJSON(str: string): any;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* A wrapper around the standard C [strftime](https://en.cppreference.com/w/c/chrono/strftime).
|
|
448
|
+
* Formats a time/date into a format as specified by the user.
|
|
449
|
+
*
|
|
450
|
+
* @param maxBytes - The number of bytes to allocate for the string that will be returned
|
|
451
|
+
* @param format - Format string, using `%`-prefixed sequences as found in [this table](https://en.cppreference.com/w/c/chrono/strftime#Format_string).
|
|
452
|
+
* @param time - The Date object (or unix timestamp, in ms) to render.
|
|
453
|
+
*/
|
|
454
|
+
export function strftime(
|
|
455
|
+
maxBytes: number,
|
|
456
|
+
format: string,
|
|
457
|
+
time: Date | number
|
|
458
|
+
): string;
|
|
413
459
|
}
|
|
414
460
|
|
|
415
461
|
declare module "quickjs:os" {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare module "quickjs:pointer" {
|
|
2
|
+
/**
|
|
3
|
+
* An opaque pointer value which can be passed around by JS
|
|
4
|
+
*/
|
|
5
|
+
export class Pointer {
|
|
6
|
+
static NULL: Pointer;
|
|
7
|
+
|
|
8
|
+
/** Returns a boolean indicating whether the provided value is a `Pointer` object. */
|
|
9
|
+
static isPointer(value: any): boolean;
|
|
10
|
+
|
|
11
|
+
/** For debug logging purposes only; format can vary from platform to platform and is not guaranteed to be present or consistent. */
|
|
12
|
+
_info?: string;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -293,6 +293,38 @@ declare module "quickjs:std" {
|
|
|
293
293
|
/** Return an object containing the environment variables as key-value pairs. */
|
|
294
294
|
export function getenviron(): { [key: string]: string | undefined };
|
|
295
295
|
|
|
296
|
+
/**
|
|
297
|
+
* Return the real user ID of the calling process.
|
|
298
|
+
*
|
|
299
|
+
* This function throws an error on windows, because windows doesn't support
|
|
300
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
301
|
+
*/
|
|
302
|
+
export function getuid(): number;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Return the effective user ID of the calling process.
|
|
306
|
+
*
|
|
307
|
+
* This function throws an error on windows, because windows doesn't support
|
|
308
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
309
|
+
*/
|
|
310
|
+
export function geteuid(): number;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Return the real group ID of the calling process.
|
|
314
|
+
*
|
|
315
|
+
* This function throws an error on windows, because windows doesn't support
|
|
316
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
317
|
+
*/
|
|
318
|
+
export function getgid(): number;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Return the effective group ID of the calling process.
|
|
322
|
+
*
|
|
323
|
+
* This function throws an error on windows, because windows doesn't support
|
|
324
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
325
|
+
*/
|
|
326
|
+
export function getegid(): number;
|
|
327
|
+
|
|
296
328
|
interface UrlGet {
|
|
297
329
|
/**
|
|
298
330
|
* Download `url` using the `curl` command line utility. Returns string
|
|
@@ -410,6 +442,20 @@ declare module "quickjs:std" {
|
|
|
410
442
|
* - octal (0o prefix) and hexadecimal (0x prefix) numbers
|
|
411
443
|
*/
|
|
412
444
|
export function parseExtJSON(str: string): any;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* A wrapper around the standard C [strftime](https://en.cppreference.com/w/c/chrono/strftime).
|
|
448
|
+
* Formats a time/date into a format as specified by the user.
|
|
449
|
+
*
|
|
450
|
+
* @param maxBytes - The number of bytes to allocate for the string that will be returned
|
|
451
|
+
* @param format - Format string, using `%`-prefixed sequences as found in [this table](https://en.cppreference.com/w/c/chrono/strftime#Format_string).
|
|
452
|
+
* @param time - The Date object (or unix timestamp, in ms) to render.
|
|
453
|
+
*/
|
|
454
|
+
export function strftime(
|
|
455
|
+
maxBytes: number,
|
|
456
|
+
format: string,
|
|
457
|
+
time: Date | number
|
|
458
|
+
): string;
|
|
413
459
|
}
|
|
414
460
|
|
|
415
461
|
declare module "quickjs:os" {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare module "quickjs:pointer" {
|
|
2
|
+
/**
|
|
3
|
+
* An opaque pointer value which can be passed around by JS
|
|
4
|
+
*/
|
|
5
|
+
export class Pointer {
|
|
6
|
+
static NULL: Pointer;
|
|
7
|
+
|
|
8
|
+
/** Returns a boolean indicating whether the provided value is a `Pointer` object. */
|
|
9
|
+
static isPointer(value: any): boolean;
|
|
10
|
+
|
|
11
|
+
/** For debug logging purposes only; format can vary from platform to platform and is not guaranteed to be present or consistent. */
|
|
12
|
+
_info?: string;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -293,6 +293,38 @@ declare module "quickjs:std" {
|
|
|
293
293
|
/** Return an object containing the environment variables as key-value pairs. */
|
|
294
294
|
export function getenviron(): { [key: string]: string | undefined };
|
|
295
295
|
|
|
296
|
+
/**
|
|
297
|
+
* Return the real user ID of the calling process.
|
|
298
|
+
*
|
|
299
|
+
* This function throws an error on windows, because windows doesn't support
|
|
300
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
301
|
+
*/
|
|
302
|
+
export function getuid(): number;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Return the effective user ID of the calling process.
|
|
306
|
+
*
|
|
307
|
+
* This function throws an error on windows, because windows doesn't support
|
|
308
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
309
|
+
*/
|
|
310
|
+
export function geteuid(): number;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Return the real group ID of the calling process.
|
|
314
|
+
*
|
|
315
|
+
* This function throws an error on windows, because windows doesn't support
|
|
316
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
317
|
+
*/
|
|
318
|
+
export function getgid(): number;
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Return the effective group ID of the calling process.
|
|
322
|
+
*
|
|
323
|
+
* This function throws an error on windows, because windows doesn't support
|
|
324
|
+
* the same uid/gid paradigm as Unix-like operating systems.
|
|
325
|
+
*/
|
|
326
|
+
export function getegid(): number;
|
|
327
|
+
|
|
296
328
|
interface UrlGet {
|
|
297
329
|
/**
|
|
298
330
|
* Download `url` using the `curl` command line utility. Returns string
|
|
@@ -410,6 +442,20 @@ declare module "quickjs:std" {
|
|
|
410
442
|
* - octal (0o prefix) and hexadecimal (0x prefix) numbers
|
|
411
443
|
*/
|
|
412
444
|
export function parseExtJSON(str: string): any;
|
|
445
|
+
|
|
446
|
+
/**
|
|
447
|
+
* A wrapper around the standard C [strftime](https://en.cppreference.com/w/c/chrono/strftime).
|
|
448
|
+
* Formats a time/date into a format as specified by the user.
|
|
449
|
+
*
|
|
450
|
+
* @param maxBytes - The number of bytes to allocate for the string that will be returned
|
|
451
|
+
* @param format - Format string, using `%`-prefixed sequences as found in [this table](https://en.cppreference.com/w/c/chrono/strftime#Format_string).
|
|
452
|
+
* @param time - The Date object (or unix timestamp, in ms) to render.
|
|
453
|
+
*/
|
|
454
|
+
export function strftime(
|
|
455
|
+
maxBytes: number,
|
|
456
|
+
format: string,
|
|
457
|
+
time: Date | number
|
|
458
|
+
): string;
|
|
413
459
|
}
|
|
414
460
|
|
|
415
461
|
declare module "quickjs:os" {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare module "quickjs:pointer" {
|
|
2
|
+
/**
|
|
3
|
+
* An opaque pointer value which can be passed around by JS
|
|
4
|
+
*/
|
|
5
|
+
export class Pointer {
|
|
6
|
+
static NULL: Pointer;
|
|
7
|
+
|
|
8
|
+
/** Returns a boolean indicating whether the provided value is a `Pointer` object. */
|
|
9
|
+
static isPointer(value: any): boolean;
|
|
10
|
+
|
|
11
|
+
/** For debug logging purposes only; format can vary from platform to platform and is not guaranteed to be present or consistent. */
|
|
12
|
+
_info?: string;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
Binary file
|
|
Binary file
|
package/npm/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const path = require("path");
|
|
2
|
-
const child_process = require("child_process");
|
|
3
2
|
|
|
4
3
|
exports.buildArtifactsLocation = function buildArtifactsLocation() {
|
|
5
4
|
return path.resolve(__dirname, "..", "build");
|
|
@@ -53,9 +52,3 @@ exports.identifyCurrentPlatform = function identifyCurrentPlatform() {
|
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
54
|
};
|
|
56
|
-
|
|
57
|
-
function runShell(cmd) {
|
|
58
|
-
return child_process
|
|
59
|
-
.spawnSync(cmd, { shell: true, encoding: "utf-8" })
|
|
60
|
-
.stdout.trim();
|
|
61
|
-
}
|