Welcome to Rampart’s documentation.¶
Contents:
-
Rampart JavaScript
- Preface
- Features
- Rampart philosophy
- Rampart Global Variable and Functions
- Process Global Variable and Functions
- Using the require Function to Import Modules
-
Extra
JavaScript Functionality
- Object Methods
- Array Methods
- String Methods
- Template Literals
- Tagged Functions
- Rest Parameters
- Template Literals and sprintf
- Unescaped Literals
- Duktape/Node.js Buffer Binding Extras
- TypedArray Methods
- TextEncoder / TextDecoder
- Map and Set
- console Extras
- Proxy.revocable
- WHATWG / W3C Web Platform APIs (experimental)
- Intl
- Other Globals
- setTimeout()
- clearTimeout()
- setInterval()
- clearInterval()
- setMetronome()
- clearMetronome()
- Additional Global Variables and Functions
- ECMAScript 2015+ and Babel.js
- ECMAScript 2015+ with transpiler
-
Skipping a second
pass: the
"noTranspile"directive
-
Rampart Utility Functions
- License
-
General
Utilities
- printf
- sprintf
- bprintf
- abprintf
- hexify
- dehexify
- stringToNumber
- stringToBuffer
- bufferToString
- objectToQuery
- queryToObject
- getchar
- readFile
- writeFile
- appendFile
- trim
- minify
- stat
- lstat
- exists
- statVfs
- exec
- getenv
- setenv
- unsetenv
- shell
- fork
- newPipe
- daemon
- forkpty
- kill
- getcwd
- chdir
- mkdir
- mkdTemp
- rmdir
- readDir
- walkDir
- glob
- zipList
- zipGet
- zipExtract
- copyFile
- cp
- rmFile
- rm
- link
- symlink
- readLink
- chmod
- realPath
- truncate
- touch
- rename
- chown
- lchown
- lchmod
- lUtimes
- sleep
- tmpDir
- homeDir
- getType
- timezone
- dateFmt
- scanDate
- autoScanDate
- use
- load
- errorConfig
- deepCopy
- eventCallback
- getScopeVars
- repl
- File Handle Utilities
- Handle stat/sync/truncate/chmod/chown/utimes
- POSIX File Descriptor I/O
- File Watching
- Compression and Checksums
- Rand, Hash and HyperLogLog
- Rampart Thread Functions
-
Rampart Vector Functions
- Preface
- Vectors in General
- Typed Vectors
-
Raw Vector Conversion Functions
- rampart.vector.raw.numbersToF64
- rampart.vector.raw.numbersToF32
- rampart.vector.raw.numbersToF16
- rampart.vector.raw.numbersToBf16
- rampart.vector.raw.numbersToI8
- rampart.vector.raw.numbersToU8
- rampart.vector.raw.f64ToNumbers
- rampart.vector.raw.f32ToNumbers
- rampart.vector.raw.f16ToNumbers
- rampart.vector.raw.bf16ToNumbers
- rampart.vector.raw.u8ToNumbers
- rampart.vector.raw.i8ToNumbers
- rampart.vector.raw.f64ToF32
- rampart.vector.raw.f64ToF16
- rampart.vector.raw.f64ToBf16
- rampart.vector.raw.f64ToI8
- rampart.vector.raw.f64ToU8
- rampart.vector.raw.f32ToF64
- rampart.vector.raw.f16ToF64
- rampart.vector.raw.bf16ToF64
- rampart.vector.raw.i8ToF64
- rampart.vector.raw.u8ToF64
- rampart.vector.raw.f32ToF16
- rampart.vector.raw.f32ToBf16
- rampart.vector.raw.f32ToI8
- rampart.vector.raw.f32ToU8
- rampart.vector.raw.f16ToF32
- rampart.vector.raw.bf16ToF32
- rampart.vector.raw.u8ToF32
- rampart.vector.raw.i8ToF32
- rampart.vector.raw.f16ToI8
- rampart.vector.raw.f16ToU8
- rampart.vector.raw.i8ToF16
- rampart.vector.raw.u8ToF16
- rampart.vector.raw.l2NormalizeNumbers
- rampart.vector.raw.l2NormalizeF64
- rampart.vector.raw.l2NormalizeF32
- rampart.vector.raw.l2NormalizeF16
- Raw Vector Distance Function
-
The rampart-sql module
- Preface
- Loading the Javascript Module
- Database Functions
- Column Data Types
- Database Indexing
- Vector Search
- String Functions
- Server Functions
-
Server Properties
-
Search and optimization
parameters
- defaultLike
- matchMode
- pRedoPtType
- textSearchMode
- stringCompareMode
- stringCompareMode/textSearchMode parameters
- btreeCacheSize
- ramRows
- ramLimit
- bubble
- optimize,noOptimize
- options,noOptions
- ignoreNewList
- indexWithin
- wildOneWord
- wildSufMatch
- wildSingle
- alLinearDict
- indexMinSublen
- dropWordMode
- metamorphStrlstMode
- Metamorph parameters
- Rank knobs
- Other Ranking Properties
- Vector Index Properties
- Embedding Properties
-
Indexing
properties
- indexSpace
- indexBlock
- indexMem
- indexMeter
- meter
- addExp
- delExp
- lstExp
- addIndexTmp
- delIndexTmp
- lstIndexTmp
- indexValues
- btreeThreshold
- maxLinearRows
- likerRows
- indexAccess
- indexMmap
- indexReadBufSz
- indexWriteBufSz
- indexMmapBufSz
- indexSlurp
- indexAppend
- indexWriteSplit
- indexBtreeExclusive
- mergeFlush
- indexVersion
- indexMaxSingle
- tableReadBufSz
- Miscellaneous Properties
- Query Protection
- Restoring Defaults
-
Search and optimization
parameters
- The rampart-sql Command Line Utilities
-
The rampart-server module
- Preface
- Loading and Using the Module
- Server Usage Details
- Standard Server Layout
- C-API
- Technical Notes
- Key to Mime Mappings
- The rampart-auth module
- The rampart-net module
- The rampart-html module
-
The rampart-chromeview module
- Preface
- Loading and Using the Module
- Calling Conventions
-
Known
Limitations
- Sync mode and event-triggered waits do not mix
- Function.prototype.toString returns a stub in plain Duktape
- Worker — Runtime only, no DOM
- page.queryObjects requires a real JSHandle prototype
- ConsoleMessage shape
- Cleanup of launched Chrome on script exit
- HTML5 drag-and-drop requires explicit interception
- Module-Level Functions
- Browser
- BrowserContext
- Page
- Frame
- JSHandle
- ElementHandle
- Mouse
- Keyboard
- Request
- Response
- Target
- CDPSession
- Worker
- Coverage
- Tracing
- FileChooser
- Accessibility
- ConsoleMessage
- Dialog
- Example: scrape a rendered SPA and save a PDF
- Using puppeteer-extras
-
The rampart-crypto module
- Preface
- Loading and Using the Module
- Encryption and Decryption
- RSA Encryption
- EC Encryption
- X25519 and Ed25519
- X448 and Ed448
- Post-Quantum (ML-KEM, ML-DSA)
- Password
- Hashing
- Key Derivation
- Random
- Comparison
- PEM / DER conversion
- BigInt
- The rampart-curl module
- The rampart-lmdb module
- The rampart-redis module
- The rampart-totext module
- The rampart-python module
- The rampart-robots module
- The rampart-cmark module
- The rampart-treesitter module
- The rampart-langtools modules
- The rampart-almanac module
- The rampart-url module
- The rampart-gm module
-
Extras
- Preface
- rampart-webserver.js Module
- Single-File Bundles
- websocket_client
- forkpty-term
- rampart-converter
- rampart-email
-
rampart-llm
- Loading the module
- Creating a connection
- Instance properties
- query()
- Chat example
- Multi-turn conversation
- Cancelling a query
- Overriding params per query
- Tool use
- Loading providers from a JSON config file
- Capacity and token usage
- Cycle detection and debug logging
- Thinking/reasoning models
- Context overflow behavior
- Using with the Rampart web server
- The c_module_template_maker utility
- rampart-cmodule
- Rampart Macros for C Modules
- Intl and WHATWG
- rampart-nodeshim Module
-
Tutorials
- Find Cities and their Closest Neighbors
- Using Websockets to Build a Chat
- Building a Pi News Aggregator
-
FAQ
-
General
- How do I install Rampart?
- What is Rampart and how does it differ from Node.js?
- Can I use npm packages with Rampart?
- What version of ECMAScript does Rampart support?
- What are Rampart’s non-standard JavaScript extensions?
- Are operations synchronous or asynchronous by default?
- What is rampart.globalize and why do I see it in so many scripts?
- Modules
- Concurrency and Asynchronous Programming
-
HTTP Server
- How does rampart-server compare to Express.js?
- How do I structure a Rampart web application?
- What is web_server_conf.js and when should I use it?
- How do I serve static files?
- How do I handle POST data and file uploads?
- How do I access request parameters?
- How do WebSockets work?
- How do I return different content types?
- How do I handle async operations in a mapped function?
- How do I generate HTML in mapped functions?
- How do I make HTTP requests from Rampart?
- Why don’t my variables persist between requests?
-
Database and Search
- What is Texis and how does it compare to SQLite?
- How does full-text index maintenance work?
- How do I build a full-text search over documents (PDF, DOCX, etc.)?
- When should I use rampart-sql vs rampart-lmdb vs rampart-redis?
- What is sql.one() and when should I use it?
- What is the difference between sql.exec() and sql.query()?
- How do I prevent SQL injection?
- File I/O and System
- Buffers and Data
- Deployment
- Interoperability
- Vibe Coding with Rampart
-
General