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

eyeglass-math

v1.0.1

Published

Math. For Sass.

Downloads

7,076

Readme

Eyeglass Math

This eyeglass plugin exposes Javascript's Math API to Sass.

To use it:

$ npm install --save eyeglass-math

Then in your Sass file(s):

@import "math";

API

The following constants are available when you import the math module.

  • $PI - The ratio of a circle's circumference to its diameter.
  • $TAU - Because Pi is wrong.
  • $E - The natural base (2.718…).

The following functions are available when you import the math module.

math/numeric

  • sign($number) - Returns the sign of the x, indicating whether $number is positive (1), negative (-1) or zero (0).

math/exponentiation

  • cbrt($number) - Returns the cube root of a number.
  • exp($number) - Returns E^x, where x is the argument, and E is Euler's constant (2.718…), the base of the natural logarithm.
  • log($number) - Returns the natural logarithm of a number.
  • log10($number) - Returns the base 10 logarithm of a number.
  • log2($number) - Returns the base 2 logarithm of a number.
  • pow(base, exponent) - Returns $base to the $exponent power.
  • sqrt($number) - Returns the positive square root of a number.

math/trigonometry

  • acos($number) - Returns the arccosine of a number.
  • asin($number) - Returns the arcsine of a number.
  • atan($number) - Returns the arctangent of a number.
  • cos($number) - Returns the cosine of a number.
  • hypot($numbers...) - Returns the square root of the sum of squares of its arguments.
  • sin($number) - Returns the sine of a number.
  • tan($number) - Returns the tangent of a number.

math/hyperbolic

  • acosh($number) - Returns the hyperbolic arccosine of a number.
  • asinh($number) - Returns the hyperbolic arcsine of a number.
  • atanh($number) - Returns the hyperbolic arctangent of a number.
  • cosh($number) - Returns the hyperbolic cosine of a number.
  • sinh($number) - Returns the hyperbolic sine of a number.
  • tanh($number) - Returns the hyperbolic tangent of a number.

Note: The functions above are available as globals with the prefix math-.