JSPM

@creditkarma/thrift-utils

0.0.9
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 5
    • Score
      100M100P100Q36247F
    • License Apache-2.0

    Utils functions for Thrift TypeScript

    Package Exports

    • @creditkarma/thrift-utils

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@creditkarma/thrift-utils) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Thrift Utils

    A set of utility functions for using Thrift in TypeScript projects. This module is part of the Credit Karma Thrift TypeScript project.

    Features include:

    • Easily encode / decode Thrift objects

    Installation

    Include in your module with the following command

    > npm i --save @creditkarma/thrift-utils

    Getting started

    Encode Thrift object to a buffer

    import { encoder } from '@creditkarma/thrift-utils'
    import { Metadata } from './generated/metadata'
    
    const metadata = new Metadata({appId: 'thrift-utils', traceId: '1234'})
    buffer = encoder(metadata).then(buffer => console.dir(buffer))

    Decode buffer into a Thrift object

    import { decoder } from '@creditkarma/thrift-utils'
    import { Metadata } from './generated/metadata'
    
    decoder(buffer, Metadata).then(metadata => console.dir(metadata))

    Contributing

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

    License

    This project is licensed under Apache License Version 2.0