Wondering what’s next for npm?Check out our public roadmap! »

    dosa

    1.0.0 • Public • Published

    dosa

    A Javascript transpiler for instrumentation

    Install

    npm install dosa

    Usage

    var dosa = require('dosa');
    var input = "var a = location.hash.split('#')[1]";
    var output = dosa.instrument(input);
    console.log(output);
    // var a = box_accessor(box_call(location.hash.split(box_string("#"))), 1);

    Instrumentation

    This is how the code will be instrumented

    func()

    box_call(func())

    a[1]

    box_accessor(a, 1)

    a+b

    box_binary(a, b, "+")

    "str"

    box_string("str")

    Credits

    I found the UglifyJS project's AST structure to be very expressive and made writing this transpiler easier for me.

    Keywords

    none

    Install

    npm i dosa

    DownloadsWeekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • avatar