Git Product home page Git Product logo

alf-converter's Introduction

alf-converter version License

Converts ALF data to latest schema version

Build Status Downloads Code Climate Coverage Status Dependencies

Install

npm install --save alf-converter

Usage


  Usage: bin [options] <files...>

  Options:

    -h, --help               output usage information
    -V, --version            output the version number
    -f, --format <format>    source file format (default, auto-detect)
    -v, --version <version>  source file format version (default, auto-detect)
    -o, --output <file>      Write output to <file> instead of stdout

API

Import
// default, ES5 (pre-compiled)
import converter from 'alf-converter/lib/converter'
import detector from 'alf-converter/lib/detector'
Require
// default, ES5 (pre-compiled)
var converter = require('alf-converter/lib/converter')
var detector = require('alf-converter/lib/detector')

converter(data [, options])

Returns a Promise

  • data: Object (Required) a single HAR or ALF object

  • options:

    • format: String one of "ALF" or "HAR".

    • version: String HAR or ALF schema version number

    • serviceToken: Boolea optional serviceToken` value to provide in final output if missing from input.

const options = {
  format: 'HAR',
  version: '1.2',
  serviceToken: 'token-foo'
}

converter(data, options)
  .then(console.log)
  .catch(console.error)
  • the promise resolves with an object representing the latest ALF version
  • If options not provided, automatic detection of source object will be triggered using detector Promise below

detector(data)

Returns a Promise

  • data: Object (Required) a single HAR or ALF object
detector(data)
  .then(console.log)
  .catch(console.error)
  • the promise resolves with an object with the following properties
  • data: Object same as the data passed to the promise

  • format: String one of "ALF" or "HAR".

  • version: String HAR or ALF schema version number


©️ www.mashape.com  ·  License: ISC  ·  Github: @mashape  ·  Twitter: @mashape

alf-converter's People

Contributors

kennethklee avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.