Jstime APIs
JSTime implements a set of native APIs on the JSTime global object and through a number of built-in modules. These APIs are heavily optimized and represent the canonical “JSTime-native” way to implement some common functionality.
JSTime strives to implement standard Web APIs wherever possible. JSTime introduces new APIs primarily for server-side tasks where no standard exists, such as file I/O and starting an HTTP server. In these cases, JSTime’s approach still builds atop standard APIs like Blob, URL, and Request.
JSTime.serve({ fetch(req: Request) { return new Response("Success!"); },});Click the link in the right column to jump to the associated documentation.
| Topic | APIs |
| --- | --- |
| HTTP server | JSTime.serve |
| File I/O | JSTime.file JSTime.write |
| Child processes | JSTime.spawn JSTime.spawnSync |
| TCP | JSTime.listen JSTime.connect |
| Transpiler | JSTime.Transpiler |
| Routing | JSTime.FileSystemRouter |
| HTML Rewriting | HTMLRewriter |
| Hashing | JSTime.hash JSTime.CryptoHasher |
| import.meta | import.meta |
| | SQLite | jstime:sqlite |
| FFI | jstime:ffi |
| Testing |
| Node-API | Node-API |
| Utilities | JSTime.version JSTime.revision JSTime.env JSTime.main JSTime.sleep() JSTime.sleepSync() JSTime.which() JSTime.peek() JSTime.openInEditor() JSTime.deepEquals() JSTime.escapeHTML() JSTime.fileURLToPath() JSTime.pathToFileURL() JSTime.gzipSync() JSTime.gunzipSync() JSTime.deflateSync() JSTime.inflateSync() JSTime.inspect() JSTime.nanoseconds() JSTime.readableStreamTo*() JSTime.resolveSync() |