Tabnine Logo For Javascript
ffi-napi
Code IndexAdd Tabnine to your IDE (free)

How to use ffi-napi

Best JavaScript code snippets using ffi-napi(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)

Most used ffi-napi functions

  • Library

Popular in JavaScript

  • mkdirp
    Recursively mkdir, like `mkdir -p`
  • commander
    the complete solution for node.js command-line programs
  • axios
    Promise based HTTP client for the browser and node.js
  • bluebird
    Full featured Promises/A+ implementation with exceptionally good performance
  • qs
    A querystring parser that supports nesting and arrays, with a depth limit
  • js-yaml
    YAML 1.2 parser and serializer
  • colors
    get colors in your node.js console
  • body-parser
    Node.js body parsing middleware
  • superagent
    elegant & feature rich browser / node HTTP with a fluent API
  • Top PhpStorm plugins
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