npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

genet

v0.0.7

Published

A node.js profiling tool

Downloads

11

Readme

genet

Coverage Status Build Status Known Vulnerabilities dependencies Status

NPM

A Node.js application profiling tool.

| | Project Info | | --------------- | ------------- | | License: | Apache-2.0 | | Build: | make | | Documentation: | http://bucharest-gold.github.io/genet/ | | Issue tracker: | https://github.com/bucharest-gold/genet/issues | | Engines: | Node.js 4.x, 6.x, 7.x

This is a simple Node.js profiling tool. Use it like this. First add it to your project.

Installation

$ npm install genet -S

Usage

Then start profiling. Put this somewhere in your app. Probably near the start.

const Genet = require('genet');
const profile = new Genet();
profile.start();

API

When requiring the genet module, the module exports the Genet object's constructor function.

// Genet is a constructor function
const Genet = require('genet');
var profile = new Genet();

new Genet(options)

Creates a new profiler. Several options are allowed.

  • options.profileName {string} - The profile name provided to v8-profiler. Defaults to 'genet'.
  • options.outputFile {string} - The output file name. Defaults to ./prof-${Date.now()}.cpuprofile.
  • options.duration {Number} - The number of milliseconds to run the profiler. Defaults to 5000.
  • options.verbose {boolean} - Determines how much log output you'll see. Defaults to false.
  • options.report {boolean} - Whether or not to generate report output. Defaults to true.
  • options.flamegraph {boolean} - Determines whether to generate a flamegraph .svg file. Defaults to false.
  • options.filter {RegExp|String} - An inclusive filter which determines what functions to include in the reports based on comparison with the path and filename for a given function.

profile.start()

Begins profiling the application. The profiler will run until options.duration milliseconds have elapsed, and then generate reports.

profile.stop()

Stops profiling the application. If the profiler has already been stopped, this function does nothing. If the profiler is still running, it cancels the timeout set by options.duration and then stops the profiler. This function returns a promise that resolves when the profiler has stopped.

Reporters

By default, genet will generate a report to the console, and to a file. Using the flamegraph option, you can also generate a flamegraph as an .svg file.

Console output will look something like this.

alt example

The flamegraph SVG might look something like this.

alt flamegraph

Contributing

Please read the contributing guide