Thrift core library in TypeScript


35110.17.27 months ago4 years agoMinified + gzip package size for @creditkarma/thrift-server-core in KB


Thrift Core

Base package for the other Thrift libraries. This will usually not be used directly. Usually consumers will get everything they need from the consuming libraries:


$ npm install --save @creditkarma/thrift-server-core


For representing 64-bit integers in JavaScript we use the node-int64 library. We extend the base class from the library with static methods for working with 64-bit integers written as strings. These functions are largely taken from the apache thrift libs and added as static methods for convinience.


Given a string of decimal digits, return a Int64 object instance.

import { Int64 } from '@creditkarma/thrift-server-core'

const i64: Int64 = Int64.fromDecimalString("89374875")


import { Int64 } from '@creditkarma/thrift-server-core'

const i64: Int64 = Int64.fromDecimalString("89374875")
const val: string = i64.toDecimalString()

// val === "89374875"
toDecimalString static

For consistency the toDecimalString method is also available statically on the Int64 class. The static method can take a number or Int64 instance.

import { Int64 } from '@creditkarma/thrift-server-core'

const i64: Int64 = new Int64(64)
const val: string = Int64.toDecimalString(i64)

// val === "64"


  • Support CompactProtocol, JsonProtocol and FramedTransport


For more information about contributing new features and bug fixes, see our Contribution Guidelines. External contributors must sign Contributor License Agreement (CLA)


This project is licensed under Apache License Version 2.0

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.