Codota Logo For Javascript
Library
Code IndexAdd Codota to your IDE (free)

How to use
Library
function
in
ffi-napi

Best JavaScript code snippets using ffi-napi.Library(Showing top 2 results out of 315)

origin: dilongfa/node-tlg

constructor(options = {}) {
    super()
    
    const defaults = {
      libraryFile: process.platform === 'win32' && 'tdjson' || 'libtdjson',
      databaseDirectory: '.tlg', 
      logFile: 'tlg.log',
      encryptionKey: '',
      verbosityLevel: 1
    }
    this.options = {...defaults, ...options}

    this.tdlib = ffi.Library(path.resolve(this.options.libraryFile), {
      'td_json_client_create'          : ['pointer', []],
      'td_json_client_send'            : ['void'   , ['pointer', 'string']],
      'td_json_client_receive'         : ['string' , ['pointer', 'double']],
      'td_json_client_destroy'         : ['void'   , ['pointer']],
      'td_set_log_file_path'           : ['int'    , ['string']],
      'td_set_log_verbosity_level'     : ['void'   , ['int']]
    })

    this.tdlib.td_set_log_file_path(path.resolve(this.options.logFile))
    this.tdlib.td_set_log_verbosity_level(this.options.verbosityLevel)

    this.instance = null
    this.fetching = new Map()
  }
origin: dilongfa/nodejs-telegram

constructor(options = {}) {
    super()
    
    const defaults = {
      libraryFile: process.platform === 'win32' && 'tdjson' || 'libtdjson',
      databaseDirectory: '.tlg', 
      logFile: 'tlg.log',
      encryptionKey: '',
      verbosityLevel: 1
    }
    this.options = {...defaults, ...options}

    this.tdlib = ffi.Library(path.resolve(this.options.libraryFile), {
      'td_json_client_create'          : ['pointer', []],
      'td_json_client_send'            : ['void'   , ['pointer', 'string']],
      'td_json_client_receive'         : ['string' , ['pointer', 'double']],
      'td_json_client_destroy'         : ['void'   , ['pointer']],
      'td_set_log_file_path'           : ['int'    , ['string']],
      'td_set_log_verbosity_level'     : ['void'   , ['int']]
    })

    this.tdlib.td_set_log_file_path(path.resolve(this.options.logFile))
    this.tdlib.td_set_log_verbosity_level(this.options.verbosityLevel)

    this.instance = null
    this.fetching = new Map()
  }
ffi-napi(npm)Library

Most used ffi-napi functions

    Popular in JavaScript

    • request
      Simplified HTTP request client.
    • minimist
      parse argument options
    • async
      Higher-order functions and common patterns for asynchronous code
    • colors
      get colors in your node.js console
    • moment
      Parse, validate, manipulate, and display dates
    • fs-extra
      fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.
    • axios
      Promise based HTTP client for the browser and node.js
    • js-yaml
      YAML 1.2 parser and serializer
    • http
    • Top plugins for WebStorm
      The challenge is finding the best plugins for JavaScript development on Intellij IDEs. Who wants to sit there and go over hundreds of plugins to pick the best?
    Codota Logo
    • Products

      Search for Java codeSearch for JavaScript codeEnterprise
    • IDE Plugins

      IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJavascript Code Index
    Get Codota for your IDE now