aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/node (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-07-25fix the encoding of `dirname`'s return value. (#3799)Gravatar Ai Hoshino 1-1/+1
2023-07-25fix some cases in the `dirname` function. (#3785)Gravatar Ai Hoshino 1-2/+83
Close: #3782
2023-07-22fix path.format for `vite build` (#3734)Gravatar dave caruso 1-5/+5
* fix path.format for vite * Update path.test.js --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-22Fix `writeFileSync` when the mode is greater than 0o777. (#3747)Gravatar Ai Hoshino 1-3/+3
Close: #3740
2023-07-20fix process.exit status code handling (#3714)Gravatar dave caruso 1-3/+3
2023-07-18zig upgrade (#3667)Gravatar Dylan Conway 6-161/+160
* upgrade * more fixes * Bump Zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-16Fixes base64url encoding for crypto (#3654)Gravatar Jarred Sumner 1-11/+6
* Fixes base64url encoding for crypto * :green_apple: * Update nodejs-apis.md --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-16Implement Workers (#3645)Gravatar Jarred Sumner 1-1/+7
* copy files * format * options * Introduce `Worker`, `onmessage`, `onerror`, and `postMessage` globals * Stub `Worker.prototype.ref` & `Worker.prototype.unref` * Update web_worker.zig * Worker works * Add "mini" mode * add wakeup * Partially fix the keep-alive issue * clean up refer behavior * Implement `serialize` & `deserialize` in `bun:jsc` & add polyfill for `node:v8` * Types & docs * Update globals.d.ts * Add mutex * Fixes --------- Co-authored-by: Dylan Conway <dylan.conway567@gmail.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-14structured clone (#3637)Gravatar Dylan Conway 1-0/+2
* copy `SerializedScriptValue` * format * make `SerializedScriptValue` compile * add `transfer` option * tests * serialize/deserialize blobs * tests for blobs * serialize/deserialize file blobs * more tests * small cleanup * format * small changes + serialize offset * slice helper * map and set test
2023-07-11Implement throwIfNoEntryGravatar Jarred Sumner 1-8/+43
2023-07-09Fixes #3530 (#3587)Gravatar Jarred Sumner 1-6/+24
* Fixes #3530 * Handle OOM * Add test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-08Implement `process.on("beforeExit", cb)` and `process.on("exit", cb)` (#3576)Gravatar Jarred Sumner 1-1/+3
* Support `process.on('beforeExit')` and `process.on('exit')` * [bun:sqlite] Always call sqlite3_close on exit * Update process.test.js --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-07[node:fs] `read`, `write` - support large numbers and BigInt (#3556)Gravatar Jarred Sumner 1-25/+25
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-03[fix] patch fs.watch sym link (#3481)Gravatar Ciro Spaciari 1-1/+1
* oopsie * add tests --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-07-01Make `buffer.toString("base64")` 4x faster (#3486)Gravatar Jarred Sumner 1-2/+2
* Add libbase64 * Add bench * Update licensing.md --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-07-01Use `BunString` in `SystemError` (#3485)Gravatar Jarred Sumner 2-20/+20
* Use `BunString` in SystemError * Use Bun::toStringRef when we will de-ref strings * Move `napi_create_error` to C++ to support `code` being a Symbol potentially * Update blob.zig * Make this test less flaky --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-29Make `node:os` `tmpdir` more consistent with Node.jsGravatar Jarred Sumner 1-26/+2
2023-06-26Implement writev & readv (#3419)Gravatar Jarred Sumner 4-4/+435
* [node:fs] Implement `writev` and `readv` * writev & readv tests * cast to const type * woops * cast --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-25Use bun.String in mkdir (#3404)Gravatar Jarred Sumner 1-13/+19
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-25fixupGravatar Jarred Sumner 1-2/+2
2023-06-25Support reading embedded files in compiled executables (#3405)Gravatar Jarred Sumner 1-0/+30
* Support reading embedded files in compiled executables * :nail_care: --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-25[fs.watch] fix reference/deinit (#3396)Gravatar Ciro Spaciari 2-247/+254
* fix js reference * fix close oops * refactor + hasPendingActivity * fmt * fix race conditions * fixup * add test calling close on error event * fix close inside close + test * cleanup
2023-06-23[feat] fs.watch (#3249)Gravatar Ciro Spaciari 6-6/+1565
* initial support * add types * fix comment * fix types * bigfix up * more fixes * fix some encoding support for watch * fix rename event * fixup * fix latin1 * add fs_events, still failing some tests * fixuup * remove unecesary check * readd tests ops * this is necessary? just testing CI/CD weird errors * just use dupe here * cleanup and fix deinit * fix zig upgrade
2023-06-21upgrade zig to `v0.11.0-dev.3737+9eb008717` (#3374)Gravatar Dylan Conway 8-99/+99
* progress * finish `@memset/@memcpy` update * Update build.zig * change `@enumToInt` to `@intFromEnum` and friends * update zig versions * it was 1 * add link to issue * add `compileError` reminder * fix merge * format * upgrade to llvm 16 * Revert "upgrade to llvm 16" This reverts commit cc930ceb1c5b4db9614a7638596948f704544ab8. --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-20Cleanup fs.utimesSync (#3363)Gravatar Jarred Sumner 1-16/+16
* Fix UB in fs.utimesSync when passing a number with an integer greater than i32 * Fix make headers --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-18Add missing ucs2 aliasGravatar Jarred Sumner 1-0/+1
2023-06-18Fix a bunch of bugs (#3352)Gravatar Jarred Sumner 4-118/+335
* Fix a bunch of bugs * undo that one * Fix crash in readdir() * woops * woops * Add comment * :scissors: * Make `readlink()` and `realpath` use much less memory * Update BunString.cpp * woopsie * Unnecessary * Don't commit these --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-13Fix crash in CJS (#3294)bun-v0.6.9Gravatar Jarred Sumner 1-4/+4
* Fix crash in CJS * Add std.heap.ArenaAllocator * Use our arena allocator * Reduce JS parser memory usage and make HMR faster * Write some comments * fix test failure & clean up this code * Update javascript.zig * make arena usage safer --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-04Implement `Bun.password` and `Bun.passwordSync` (#3204)Gravatar Jarred Sumner 1-0/+12
* Implement `Bun.password.{verify, hash}` and `Bun.passwordSync.{verify, hash}` * flip the booleans * delete unused * Add `cost` for `"bcrypt"`, add `"memoryCost"` and `"timeCost'` for argon2, use SHA512 * Update bun.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-03Fix crash with path parse in win32 (#3187)bun-v0.6.7Gravatar Jarred Sumner 1-4/+8
* Update CommonJSModuleRecord.cpp * smaller * [node:path] Fix crash, mark TODO --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-01Rename `ptr` to `_unsafe_ptr_do_not_use` (#3163)Gravatar Jarred Sumner 1-5/+8
* Rename `ptr` to `_unsafe_ptr_do_not_use` * Fixup --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-06-01random fixes that help vite/sveltekit (#3140)Gravatar dave caruso 1-18/+5
* existsSync with invalid paths should return false * partially support file urls (does not do percent encoding) * add utf16 support for Path.isAbsoluteString * Update src/resolver/resolver.zig Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> * fixups * revert * prettier format --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-05-31isolated version of Path compatible with nodejs (#3143)Gravatar Ciro Spaciari 1-4/+3
2023-05-31invert base/filename internally (#3141)Gravatar Ciro Spaciari 1-3/+3
2023-05-31fix(path) fix parse behavior (#3134)Gravatar Ciro Spaciari 1-6/+9
2023-05-26Fix crash in test.todo + remove JSC C API usages in bun:test (#3079)Gravatar Jarred Sumner 1-1/+1
* Fix crash in test.todo * remove usages of JSC C API in bun:test * Remove additional JSC-C API usages * fix `make headers` * URLSearchParams.length * FormData length * URLSearchParams length * Fix `make headers` * very fancy length * Fix bug with exceptions being ignored sometimes * Add tests for extension toHaveLength --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-21fix(tls.connect) fix SNI on tls sockets and also servername (mongodb) (#2934)Gravatar Ciro Spaciari 2-11/+62
* fixes SNI on tls sockets and also servername * 💅 * 💅 * add support for https and wss * fix bun types * support Bun.file on ca, key and cert * 💅 * add setTimeout (makes fastify run) * fix httpVersion * fix WebSocketServer and add listen event * fix ws exports and http listening * fix default import * bump uws * add nodebuffer compatibility * fix drain and allow more passing tests to run * fix enqueud messages * default to arraybuffer * fix constructor binaryType * fmt * fixup * skip some tests * skip more * skip fault tests * reuse encoder instance * fix handshake WS Client * temporary revert handshake fix * fix handshake * disable all socket.io test temp * fixup * add back socket.io tests * use node_fs to read cert, ca and key on server.zig * throw the error returned by NodeFS * 💅
2023-05-20[internal] Make `JSC.NewFunction` more type safeGravatar Jarred Sumner 1-1/+1
2023-05-17Fixes https://github.com/oven-sh/bun/issues/2931Gravatar Jarred Sumner 1-1/+4
2023-05-15Make `bun build --compile` a little more resilient, output better errors, ↵Gravatar Jarred Sumner 1-0/+15
and clean up files
2023-05-14Fix `process.argv` with standaloneGravatar Jarred Sumner 1-7/+13
2023-05-14feat(Timer.refresh) add refresh support on Timer (#2874)Gravatar Ciro Spaciari 1-0/+5
* add refresh support on Timer * fix this return * add refresh setTimeout tests * fix tests and add setInterval test * use setCached for arguments and callback --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-05-11fix(fs) mkdtemp and mkdtempSync errors (#2851)Gravatar Ciro Spaciari 1-7/+11
* fix mkdtemp * fmt * fix errno
2023-04-27Don't preallocate unless its profitableGravatar Jarred Sumner 1-3/+3
2023-04-27very slightly faster open() and writeFileSync() (#2759)Gravatar Jarred Sumner 2-45/+105
* Make open() slightly faster on macOS * Support using `writeFileSync` from native code * Add `openat$NOCANCEL` symbol * fixups for linux * do benchmark --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-19Fix broken autocompleteGravatar Jarred Sumner 9-24/+24
2023-04-17Fixes #2676Gravatar Jarred Sumner 1-2/+2
2023-03-28More bug fixes (#2486)Gravatar Jarred Sumner 1-5/+78
* readline_promises test fix * fix `escapeHTML` for baseline builds * fs test fixes, use `tmpdir()` * add paths for `resolve.test.js` * isError with toString symbol and error prototype * comment about `toString` * skip async macro transform * test cleanup, skip stack format test * readline undo and redo fix * capture error from readline keypress * Update tcp-server.test.ts * use `removefileat` for recursive rmdir * use strong for `signal.reason` * initialize `m_flags` * directory with file fs test * recursive option * import expect * could be less than * move abort signal tests to another process * fix typecheck --------- Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2023-03-14Fix text formatting in .remoteAddress in `ServerWebSocket` and `Socket`Gravatar Jarred Sumner 1-20/+3
Fixes #2387
2023-03-07"binary" is an alias of "latin1"Gravatar Jarred Sumner 1-2/+5
Fixes https://github.com/oven-sh/bun/issues/2110