@robinpath/buffer
Advanced tools
+95
| # @robinpath/buffer | ||
| > Buffer and encoding utilities: base64, base64url, hex, byte operations | ||
|     | ||
| ## Why use this module? | ||
| The `buffer` module lets you: | ||
| - Create a base64 buffer from a string | ||
| - Convert a base64 buffer to string | ||
| - Create base64 from hex string | ||
| - Convert base64 to hex string | ||
| - Encode string to base64 | ||
| All functions are callable directly from RobinPath scripts with a simple, consistent API. | ||
| ## Installation | ||
| ```bash | ||
| npm install @robinpath/buffer | ||
| ``` | ||
| ## Quick Start | ||
| No credentials needed — start using it right away: | ||
| ```robinpath | ||
| buffer.toString "aGVsbG8=" | ||
| ``` | ||
| ## Available Functions | ||
| | Function | Description | | ||
| |----------|-------------| | ||
| | `buffer.fromString` | Create a base64 buffer from a string | | ||
| | `buffer.toString` | Convert a base64 buffer to string | | ||
| | `buffer.fromHex` | Create base64 from hex string | | ||
| | `buffer.toHex` | Convert base64 to hex string | | ||
| | `buffer.toBase64` | Encode string to base64 | | ||
| | `buffer.fromBase64` | Decode base64 to string | | ||
| | `buffer.toBase64Url` | Encode string to URL-safe base64 | | ||
| | `buffer.fromBase64Url` | Decode URL-safe base64 to string | | ||
| | `buffer.byteLength` | Get the byte length of a string | | ||
| | `buffer.concat` | Concatenate multiple base64 buffers | | ||
| | `buffer.compare` | Compare two base64 buffers | | ||
| | `buffer.isBase64` | Check if a string is valid base64 | | ||
| ## Examples | ||
| ### Convert a base64 buffer to string | ||
| ```robinpath | ||
| buffer.toString "aGVsbG8=" | ||
| ``` | ||
| ### Create base64 from hex string | ||
| ```robinpath | ||
| buffer.fromHex "48656c6c6f" | ||
| ``` | ||
| ### Convert base64 to hex string | ||
| ```robinpath | ||
| buffer.toHex "aGVsbG8=" | ||
| ``` | ||
| ## Integration with RobinPath | ||
| ```typescript | ||
| import { RobinPath } from "@wiredwp/robinpath"; | ||
| import Module from "@robinpath/buffer"; | ||
| const rp = new RobinPath(); | ||
| rp.registerModule(Module.name, Module.functions); | ||
| rp.registerModuleMeta(Module.name, Module.functionMetadata); | ||
| const result = await rp.executeScript(` | ||
| buffer.toString "aGVsbG8=" | ||
| `); | ||
| ``` | ||
| ## Full API Reference | ||
| See [MODULE.md](./MODULE.md) for complete documentation including all parameters, return types, error handling, and advanced examples. | ||
| ## Related Modules | ||
| - [`@robinpath/json`](../json) — JSON module for complementary functionality | ||
| ## License | ||
| MIT |
+25
-7
| { | ||
| "name": "@robinpath/buffer", | ||
| "version": "0.1.0", | ||
| "publishConfig": { "access": "public" }, | ||
| "version": "0.1.1", | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "type": "module", | ||
| "main": "dist/index.js", | ||
| "types": "dist/index.d.ts", | ||
| "exports": { ".": { "import": "./dist/index.js", "types": "./dist/index.d.ts" } }, | ||
| "files": ["dist"], | ||
| "scripts": { "build": "tsc", "test": "node --import tsx --test tests/*.test.ts" }, | ||
| "peerDependencies": { "@wiredwp/robinpath": ">=0.20.0" }, | ||
| "devDependencies": { "@wiredwp/robinpath": "^0.30.1", "tsx": "^4.19.0", "typescript": "^5.6.0" } | ||
| "exports": { | ||
| ".": { | ||
| "import": "./dist/index.js", | ||
| "types": "./dist/index.d.ts" | ||
| } | ||
| }, | ||
| "files": [ | ||
| "dist" | ||
| ], | ||
| "scripts": { | ||
| "build": "tsc", | ||
| "test": "node --import tsx --test tests/*.test.ts" | ||
| }, | ||
| "peerDependencies": { | ||
| "@wiredwp/robinpath": ">=0.20.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@wiredwp/robinpath": "^0.30.1", | ||
| "tsx": "^4.19.0", | ||
| "typescript": "^5.6.0" | ||
| } | ||
| } |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
22418
12.7%10
11.11%0
-100%96
Infinity%1
Infinity%