MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

update README indents

+39 -39
+39 -39
README.md
··· 2 2 3 3 **Ant-sized JavaScript Runtime** 4 4 5 - A minimal embedded JavaScript engine with async/await, promises, modules, and built-in APIs for HTTP servers, timers, crypto, and JSON. 5 + A JavaScript runtime that fits in your pocket โ€” Full async/await, modules, HTTP servers, crypto, and more. 6 6 7 7 ๐Ÿ“– [Read the blog post about Ant](https://s.tail.so/js-in-one-month) 8 8 ··· 106 106 ### Navigator 107 107 108 108 ```js 109 - navigator.userAgent; // User agent string 110 - navigator.platform; // Platform string 111 - navigator.hardwareConcurrency; // CPU thread count 112 - navigator.locks; // Web Locks API 109 + navigator.userAgent; // User agent string 110 + navigator.platform; // Platform string 111 + navigator.hardwareConcurrency; // CPU thread count 112 + navigator.locks; // Web Locks API 113 113 ``` 114 114 115 115 ### Cryptography 116 116 117 117 ```js 118 - crypto.random(); // Secure random number 119 - crypto.randomBytes(); // Generate random bytes 120 - crypto.randomUUID(); // UUID v4 121 - crypto.randomUUIDv7(); // UUID v7 (time-ordered) 122 - crypto.getRandomValues(); // Fill TypedArray with random values 123 - btoa(); // Base64 encoding (built-in) 124 - atob(); // Base64 decoding (built-in) 118 + crypto.random(); // Secure random number 119 + crypto.randomBytes(); // Generate random bytes 120 + crypto.randomUUID(); // UUID v4 121 + crypto.randomUUIDv7(); // UUID v7 (time-ordered) 122 + crypto.getRandomValues(); // Fill TypedArray with random values 123 + btoa(); // Base64 encoding (built-in) 124 + atob(); // Base64 decoding (built-in) 125 125 ``` 126 126 127 127 ### Path Utilities ··· 135 135 ### Process 136 136 137 137 ```js 138 - Ant.process.env; // Environment variables (with .env support) 139 - Ant.process.cwd; // Current working directory 140 - Ant.process.argv; // Command line arguments 141 - Ant.process.pid; // Process ID 142 - Ant.process.exit(); // Exit with code 143 - Ant.process.cpuUsage(); // CPU usage statistics 138 + Ant.process.env; // Environment variables (with .env support) 139 + Ant.process.cwd; // Current working directory 140 + Ant.process.argv; // Command line arguments 141 + Ant.process.pid; // Process ID 142 + Ant.process.exit(); // Exit with code 143 + Ant.process.cpuUsage(); // CPU usage statistics 144 144 ``` 145 145 146 146 ### Performance 147 147 148 148 ```js 149 - performance.now(); // High-resolution timestamp 150 - performance.timeOrigin; // Time origin for measurements 149 + performance.now(); // High-resolution timestamp 150 + performance.timeOrigin; // Time origin for measurements 151 151 ``` 152 152 153 153 ### Ant Global 154 154 155 155 ```js 156 - Ant.version; // Runtime version 157 - Ant.target; // Build target 158 - Ant.revision; // Git revision 159 - Ant.buildDate; // Build date 160 - Ant.serve(); // Start HTTP server 161 - Ant.signal(); // Register signal handlers 162 - Ant.sleep(); // Sleep in seconds 163 - Ant.msleep(); // Sleep in milliseconds 164 - Ant.usleep(); // Sleep in microseconds 165 - Ant.gc(); // Trigger garbage collection 166 - Ant.alloc(); // Get memory allocation info 167 - Ant.stats(); // Get runtime statistics 168 - Ant.typeof(); // Get internal type name 156 + Ant.version; // Runtime version 157 + Ant.target; // Build target 158 + Ant.revision; // Git revision 159 + Ant.buildDate; // Build date 160 + Ant.serve(); // Start HTTP server 161 + Ant.signal(); // Register signal handlers 162 + Ant.sleep(); // Sleep in seconds 163 + Ant.msleep(); // Sleep in milliseconds 164 + Ant.usleep(); // Sleep in microseconds 165 + Ant.gc(); // Trigger garbage collection 166 + Ant.alloc(); // Get memory allocation info 167 + Ant.stats(); // Get runtime statistics 168 + Ant.typeof(); // Get internal type name 169 169 ``` 170 170 171 171 ### Foreign Function Interface (FFI) ··· 208 208 ### Module System 209 209 210 210 ```js 211 - import 'ant:fs' // Built-in fs module 212 - import 'ant:path' // Built-in path module 213 - import 'ant:shell' // Built-in shell module 214 - import 'ant:ffi' // Built-in FFI module 215 - import 'node:*' // Node.js-style aliases 216 - import from 'https://...' // Import from URLs 211 + import 'ant:fs' // Built-in fs module 212 + import 'ant:path' // Built-in path module 213 + import 'ant:shell' // Built-in shell module 214 + import 'ant:ffi' // Built-in FFI module 215 + import 'node:*' // Node.js-style aliases 216 + import from 'https://...' // Import from URLs 217 217 import data from './data.json' // JSON imports 218 218 import text from './file.txt' // Text imports 219 219 ```