New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

perfume.js

Package Overview
Dependencies
Maintainers
1
Versions
157
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

perfume.js

[![NPM version](https://badge.fury.io/js/perfume.js.svg)](https://www.npmjs.org/package/perfume.js) [![Build Status](https://travis-ci.org/Zizzamia/perfume.js.svg?branch=master)](https://travis-ci.org/Zizzamia/perfume.js) [![NPM Downloads](http://img.shie

  • 0.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15K
decreased by-54.12%
Maintainers
1
Weekly downloads
 
Created
Source

Perfume.js v0.2.2

NPM version Build Status NPM Downloads

Perfume is a tiny JavaScript library for measuring Short/Long Script, First Meaningful Paint, TTI (Time to Interactivity), annotating them to the DevTools timeline and reporting the results to Google Analytics.

Installing

npm (https://www.npmjs.com/package/perfume.js):

npm install perfume.js --save

Importing library

You can import the generated bundle to use the whole library generated by this starter:

import Perfume from 'perfume.js';

Additionally, you can import the transpiled modules from dist/es in case you have a modular library:

import Perfume from 'node_modules/perfume.js/dist/es/perfume';

Universal Module Definition

import Perfume from 'node_modules/perfume.js/perfume.umd.js';

Start measuring

First Meaningful Paint

Page load is a key aspect of how a user perceives the performance of your page. See Measure Performance with the RAIL Method for more information.

const perfume = new Perfume();
perfume.firstPaint(); // ⚡️ Perfume.js: firstPaint 1604 ms
Annotate metrics in the DevTools

Performance.mark (User Timing API) is used to create an application-defined peformance entry in the browser's performance entry buffer.

const perfume = new Perfume();
perfume.start('fibonacci');
this.fibonacci(400);
perfume.end('fibonacci', true); // ⚡️ Perfume.js: fibonacci 0.14 ms

[Performance Mark]

Custom Logging

Save the duration and print it out when/how you best desire.

perfume.start('fibonacci');
fibonacci(400);
const duration = this.perfume.end('fibonacci');
perfume.log('Custom logging', duration); // ⚡️ Perfume.js: Custom logging 0.14 ms

Develop

  • npm t: Run test suite
  • npm start: Run npm run build in watch mode
  • npm run test:watch: Run test suite in interactive watch mode
  • npm run test:prod: Run linting and generate coverage
  • npm run build: Generate bundles and typings
  • npm run lint: Lints code
  • npm run commit: Commit using conventional commit style (husky will tell you to use it if you haven't :wink:)

Credits

Made with ☕️ by @zizzamia and I want to thank some friends and projects for the work they did:

  • Appmetrics.js to inspired me to start writing this library and give me some of the base ideas for the class architecture;
  • Popper.js for having inspired me in writing my first library in typescript;
  • The Contributors for their much appreciated Pull Requests and bug reports;
  • you for the star you'll give to this project and for being so awesome to give this project a try 😄

Code and documentation copyright 2017 Leonardo Zizzamia. Code released under the MIT license. Docs released under Creative Commons.

FAQs

Package last updated on 30 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc