Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/denops_std/function/nvim/mod.ts>msgpackdump

📚 Standard module for denops.vim
Go to Latest
function msgpackdump
import { msgpackdump } from "https://deno.land/x/denops_std@v4.1.4/function/nvim/mod.ts";

Convert a list of VimL objects to msgpack. Returned value is a |readfile()|-style list. When {type} contains "B", a |Blob| is returned instead. Example: call writefile(msgpackdump([{}]), 'fname.mpack', 'b') or, using a |Blob|: call writefile(msgpackdump([{}], 'B'), 'fname.mpack') This will write the single 0x80 byte to a fname.mpack file (dictionary with zero items is represented by 0x80 byte in messagepack). Limitations:

  1. |Funcref|s cannot be dumped.
  2. Containers that reference themselves cannot be dumped.
  3. Dictionary keys are always dumped as STR strings.
  4. Other strings and |Blob|s are always dumped as BIN strings.
  5. Points 3. and 4. do not apply to |msgpack-special-dict|s.

Parameters

denops: Denops
list: unknown
optional
type: unknown

Returns

Promise<unknown>