CBOR(1)
π CBOR(1) β the cbor bestie manual π
okay so hi, you're looking at the manual for cbor, and honestly? she ate. let's get into it π
β¨ NAME β¨
cbor β Batteries-included CBOR Read, Edit, Print Loop π¦
like, a whole REPL but make it CBOR. periodt.
πΈ SYNOPSIS πΈ
# cbor
cbor [VERSION] (javascript output from typing 0x00)
cbor> ...
^D
that's the whole vibe. you type stuff, she prints stuff, you hit ^D and go touch grass π±
π DESCRIPTION π
so cbor is basically a version of the Node Read, Edit, Print Loop (that's the REPL, docs live at https://nodejs.org/api/repl.html) β but with a glow-up β¨
here's what's different in this REPL, no cap:
- most interactive results output are followed by their CBOR representation π₯
- input that starts with
0x,',", or`and is followed only by hex digits gets taken as a hex-encoded binary string, decoded, and displayed in a format based on the--typeoption π - the following are already imported and in-scope of the REPL, so you don't gotta do anything:
- the
cborpackage - the
nofilterpackage (asNoFilter) - all of the properties and functions of the
cborpackage (e.g.encode,decode) - Promises are automatically awaited, their results printed, and their results going into the
_variable rather than the promise itself π«Ά
- the
heads up bestie π by default this command shares its history with the main Node REPL, in the file~/.node_repl_history. if you wanna modify that, set theNODE_REPL_HISTORYenvironment variable to the name of a file, or''to disable history. (more on that below, i gotchu)
π OPTIONS π
-V,--versionβ output the version number π«-c,--colorβ Force color output even if stdout is not a TTY π-t,--type <type>β Output type (one of:javascript,diagnose,comment) (default:"javascript") β-h,--helpβ display help for π₯² (yes the sentence just. ends there. i'm not fixing it, it's iconic)
π¦ ENVIRONMENT VARIABLES π¦
All of the normal environment variables from Node apply. In particular:
NODE_REPL_HISTORYβ When a valid path is given, persistent REPL history will be saved to the specified file rather than.node_repl_historyin the user's home directory. Setting this value to''(an empty string) will disable persistent REPL history. Whitespace will be trimmed from the value. On Windows platforms environment variables with empty values are invalid so set this variable to one or more spaces to disable persistent REPL history. π (windows pls)NODE_REPL_HISTORY_SIZEβ Controls how many lines of history will be persisted if history is available. Must be a positive number. Default:1000. πNODE_REPL_MODEβ May be either'sloppy'or'strict'. Default:'sloppy', which will allow non-strict mode code to be run. π
π SEE ALSO π
node-cborhttps://github.com/hildjj/node-cbor/ π§- RFC 8949 https://www.rfc-editor.org/rfc/rfc8949.html π
and that's the page bestie, you're officially certified π this was CBOR(1), from November 2022 β go forth and decode, you absolute main character πβ¨
π¦ where this page comes from
- ubuntu noble: node-cbor 8.1.0+dfsg+~cs5.2.1-3 Β· MIT
- ubuntu resolute: node-cbor 8.1.0+dfsg+~cs5.2.1-3 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms