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

1-liners

v0.4.2

Published

Useful oneliners and shorthand functions

Downloads

4,720

Readme

MADE IN SWITZERLAND

Coverage Status Build Status Dependency Status npm version Stability: unstable Join the chat at https://gitter.im/1-liners/1-liners

Functional tools that couldn’t be simpler.

We’re proud to present 1-liners – a dead simple functional utility belt. 137 one-liner functions (and counting). Each hand-crafted with love and attention.

Our decalogue

You get a product of top-quality functional programming craftmanship. Each function follows the KISS principle, which we’ve broken down into ten strict rules.

We always follow them. You have our word.

  1. Each function shall fit in one readable line of code
    – take a glimpse at the source and you know exactly what’s going on.
     

  2. Each function shall have no side-effects
    – you can use it with confidence.
     

  3. Each function shall have a fixed number of arguments
    – it’s dead easy to bind, curry and uncurry, apply partially, implode and explode.
     

  4. Each function shall deal with data in an immutable way
    – no more debugging nightmares.
     

  5. Each function shall take data as the last argument
    – this makes currying and composing new functions a breeze.
     

  6. Each function shall be in a separate micro-module
    – you only load/bundle the single 1-liner you need.
     

  7. Each function shall be thoroughly tested
    – 100% code coverage guaranteed. We even test if every function fits in one line!
     

  8. Each function shall have great documentation
    – the docs explain usage, present the source, and link to the specs.
     

  9. We shall provide functional versions of native object methods
    – like reduce(callback, array) for array.reduce(callback).
     

  10. We shall provide functional versions of language constructs
    – like plus(a, b) for a + b.
     

Usage

Install

$ npm install --save 1-liners

Usage in ES5

// The lightweight, recommended way:
var map = require('1-liners/map');

// Sometimes practical:
var map = require('1-liners').map;

Usage in ES 2015 (formerly ES6)

// The lightweight, recommended way:
import map from '1-liners/module/map';

// Sometimes practical:
import { map, filter } from '1-liners/module';

API

Checkout the documentation

Maintainers

| stoeffel | tomekwi | hemanth | | :--:|:--:|:--: | | stoeffel | tomekwi | hemanth |

| davidchase | tristaaan | | :--:|:--: | | davidchase | tristaaan |

created with gh-contributors-table

License

MIT © stoeffel tomekwi hemanth davidchase tristaaan