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

overslash

v0.0.10

Published

A tiny modular Javascript utility library

Downloads

21

Readme

overslash

NPM version Travis CI Test coverage Dependencies status Dev Dependencies status License

NPM install

| Overslash is no longer maintained. Please, use @mobilabs/overslash now. | | --- |

A tiny modular Javascript utility library

Overslash is an utility library as Underscore and Lodash. However, Overslash doesn't pretend to compete with these honorable libraries. Overslash implements only a small subset of the functions that can be found in these library.

Overslash ambition is quite different. Overslash is modular. You can build a version with only the subset of the functions you need.

Then, you can embed it in your own library. So, you can ship your library without any external dependencies.

API

Method                  | Description
_.isUndefined(n)        | Returns true if the variable n is undefined (else false),
_.isNull(n)             | Returns true if the value of n is null,
_.isBoolean(n)          | Returns true if the value of n is a boolean,
_.isString(n)           | Returns true if the value of n is a string,
_.isNumber(n)           | Returns true if the value of n is a number,
_.isNaN(n)              | Returns true if the value of n is a NaN,
_.isOdd(n)              | Returns true if the value of n is an odd number,

_.isObject(n)           | Returns true if the variable n is an object,
_.isMath(n)             | Returns true if the variable n is a Math object,
_.isDate(n)             | Returns true if the variable n is a Date,
_.isArray(n)            | Returns true if the variable n is an array,
_.isFunction(n)         | Returns true if the variable n is a function,
_.isEmpty(n)            | Returns true if the a given array, string or object is empty,

_.clone(o)              | Clones (deep) a literal object or an array,
_.extend(o, s)          | Extends a given object with all the properties in passed-in, object(s),
_.keys(o)               | Retrieves all the names of the object's own enumerable properties,
_.forPropIn             | Parses all the names of the object's own enumerable properties,

_.contains(arr, value)  | Returns true if the array contains the passed-in value,
_.flatten(arr)          | Flattens a nested array (the nesting can be to any depth),
_.max(arr)              | Returns the maximum value in the array,
_.min(arr)              | Returns the minimum value in the array,
_.share(arr)            | Returns the list of the elements the passed-in arrays have in common,

_.token()               | Returns a unique string pattern in base 36 ([0-9a-z]),
_.makeid()              | Returns a unique string pattern with a predefined length,
_.csv2array(csv)        | Converts an csv block to an array or arrays,

Nota: We assume here that _ is a reference to overslash.

How to embed Overslash in your library

Overslash is included in a Javascript module pattern. It exports only the variable overslash outside this module. Thus, you can safely embed Overslash in your library without any risk to pollute your namespace.

Overslash module pattern looks like this:

(function(root, factory) {
  'use strict';

  if (typeof define === 'function' && define.amd) {
    define([''], factory);
  } else if (typeof exports === 'object') {
    module.exports = factory();
  } else {
    // Browser globals.
    root.overslash = factory();
  }
}(this, function() {
  'use strict';

  var overslash = {
    // ...
  };

  return overslash;
}));

You just need to replace this by the namespace of your library:

(function(root, factory) {
  // ...
    // Browser globals.
    root.overslash = factory();
  }
}(this, function() { // <--- replace this by your library namespace
  // ...

You can now add a reference to Overslash inside your library:


var myLibraryName = {};

// Embed Overslash and replace 'this' by 'myLibraryName':
(function());

// You can now access to Overslash:
var _ = myLibraryName.overslash;

License

MIT.