babel-plugin-sjsp

0.1.2 • Public • Published

babel-plugin-sjsp ⚡

A babel plugin, for sjsp (Simple JavaScript Profiler).

Build Status Version

What is it

This is a babel plugin for JavaScript profiler, inspired by sjsp, which is implemented in Haskell. And babel-plugin-sjsp is forked from node-sjsp.

How to install

npm install --save-dev babel-plugin-sjsp

Usage

  • .babelrc
{
  "plugins": ["babel-plugin-sjsp", { "interval": 10 }]
}
  • Options

interval

Type: number Default: 1 [sec]

output interval.

Open the page with your browser and you can see profiles in the JavaScript console every 1 seconds. (you can change this interval by interval option)

========== SORT BY TIME ==========
time:    0.60sec   count:    1777    something.js          test1   (line:   7, col: 17)   function test1(){
time:    0.60sec   count:    1701    something.js          test0   (line:   1, col: 17)   function test0(){
time:    0.58sec   count:    1601    something.js          test4   (line:  25, col: 17)   function test4(){
time:    0.57sec   count:    1703    something.js          test2   (line:  13, col: 17)   function test2(){
time:    0.54sec   count:    1632    something.js          test3   (line:  19, col: 17)   function test3(){
time:    0.53sec   count:    1586    something.js          test5   (line:  31, col: 17)   function test5(){
========== SORT BY COUNT ==========
time:    0.60sec   count:    1777    something.js          test1   (line:   7, col: 17)   function test1(){
time:    0.57sec   count:    1703    something.js          test2   (line:  13, col: 17)   function test2(){
time:    0.60sec   count:    1701    something.js          test0   (line:   1, col: 17)   function test0(){
time:    0.54sec   count:    1632    something.js          test3   (line:  19, col: 17)   function test3(){
time:    0.58sec   count:    1601    something.js          test4   (line:  25, col: 17)   function test4(){

For details, see original document

How it works

See original document

Limitation

This profiling is available for browser only now.

LICENSE

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i babel-plugin-sjsp

Weekly Downloads

1

Version

0.1.2

License

MIT

Last publish

Collaborators

  • bokuweb