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

sassy

v1.0.0

Published

A small SCSS/SASS library that adds essential functionality and makes working with maps easier.

Downloads

22

Readme

Sassy

Sassy eases the pain for object-oriented programmers and makes getting around in SASS a little easier.

###Overview

Sassy provides some essential functionality and makes working with maps much easier.

It also includes a debugging utility for unit-testing (see notes at the bottom).

Methods:

  • get
  • set
  • has
  • compare
  • type
  • types
  • types-same
  • contains
  • explode
  • implode
  • thru
  • print
  • apply
  • increase
  • decrease

Method Uses:

@note All methods that use a ( map, key, ... ) signature allow for nested maps using a key list!

Signature:

  • get( map, key )
  • get( map, ( nested, key ) )

Supported types: map

Signature:

  • set( map, key, value )
  • set( map, ( nested, key ), value )

@note Remember SASS objects are immutable. Replace your map reference each time!

Supported types: map

Signature: has( map, key, [return], [default] )

Optional default value IF NO KEY (otherwise returns null).

Supported types: map

Signature: compare( A, B )

Supported types: any

Signature: type( var, [against] )

Supported types: any

Signature: types ( varN... )

Supported types: any

Signature: types-same ( varN... )

Supported types: any

Signature: contains( haystack, needle )

Supported types: map, list, string

Signature: explode( string, [delimiter='-'] )

Supported types: string

Signature: implode( list, [wrap=false], [glue=', '] )

@note wrap is optional. if true, adds ( ) to string before returning

Supported types: list

Signature: thru( any )

Supported types: any

Signature: print( map )

Supported types: map

Signature:

  • apply( method_name, argslist... )
  • apply( method_name, ( list, of, args ) )
  • apply( method_name, argsmap )

Supported types: function

Signature:

  • increase( number, [x=1] )
  • increase( map, key, [x=1] )

Supported types: number, map with number as value to a key

Signature:

  • decrease( number, [x=1] )
  • decrease( map, key, [x=1] )

Supported types: number, map with number as value to a key

Signature: pluck( key, maps.. )

@note also accepts a list of maps

Supported types: map


Sassy Debugger

I put together a SASS debug utility based loosely on my much more robust JS debugger.

There are only 3 mixins you need (really only "test", but it's better to use all 3).

Signature: @include start(debug_name)

Signature:

  • @include test( method_name, arguments, [expect=true] )
  • @include test( name, result, [expect=true] )

You should always use a list of arguments instead of a result boolean.

The result boolean option is there for edge cases where comparing the result isn't so easy.

If you need to pass a single list, use an argsmap

( args: ( your, list ) )

You can add a variation string as the 4th parameter. Useful if debugging similar signatures.

Mixin: complete

reports a summary of pass/fail

@note fire this after all of your tests. it will tell you that all tests passed or which ones failed (and why).

--

That's all! Enjoy the software!