Tabnine Logo For Javascript
Library
Code IndexAdd Tabnine 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

    • cheerio
      Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
    • yargs
      yargs the modern, pirate-themed, successor to optimist.
    • ms
      Tiny millisecond conversion utility
    • debug
      small debugging utility
    • bluebird
      Full featured Promises/A+ implementation with exceptionally good performance
    • ws
      Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js
    • mocha
      simple, flexible, fun test framework
    • express
      Fast, unopinionated, minimalist web framework
    • webpack
      Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
    • From CI to AI: The AI layer in your organization
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
    Get Tabnine for your IDE now