constructor(libpath?: string)
- initializes FFI with provided libpath. If path isn't provided, the hardcoded ldconfig path is usedinit(): { errMsg?: string }
- tries to initialize LibMagic and obtain cookie necessary for further operationsfile(path: string): { result?: string; errMsg?: string }
- returns mime type of a fileclose(): void
- closeslibarchive
that was opened by the constructor
libpath
- readonly path to libmagic - it's the one that was either passed to the constructor or a default, hardcoded one
deno
- tested on 1.17 and uplibarchive.so
- for archives handling
unstable
allow-ffi