Skip to content

sarpt/deno-libmagic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deno-libmagic

methods

  • constructor(libpath?: string) - initializes FFI with provided libpath. If path isn't provided, the hardcoded ldconfig path is used
  • init(): { errMsg?: string } - tries to initialize LibMagic and obtain cookie necessary for further operations
  • file(path: string): { result?: string; errMsg?: string } - returns mime type of a file
  • close(): void - closes libarchive that was opened by the constructor

properties

  • libpath - readonly path to libmagic - it's the one that was either passed to the constructor or a default, hardcoded one

dependencies for running

  • deno - tested on 1.17 and up
  • libarchive.so - for archives handling

permissions

  • unstable
  • allow-ffi

About

Simple libmagic utils for deno

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published