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

useme

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

useme

a bunch of hacky useful things

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

useme

NPM

Travis Build Status

a set of functions that I refuse to rewrite all over the place though they are just one liners

Install it

npm install useme --save

Usage

val

returns a default value if value is unset

var empty = null;
console.log(useme.val(empty, 'wahoo'));  // prints wahoo
valProperty

return a default value if object property is unset

var data = useme.valProperty({
    one : 1,
    two : 2
  }, 'wahoo');
console.log(data.three);  // prints wahoo
include, exclude

Nothing fancy, I jus don't like writing this kind of filters over and over

var array = [1, 2, 3, 4];
var included = useme.include(array, [2, 4]);
var excluded = useme.exclude(array, [2, 4]);
console.log(included); // [2, 4]
console.log(excluded); // [1, 3]
send

wrapper around request module, returning a promise

useme.send({ uri : myawesomeuri })
  .then(function (data) {
    console.log(data.request);
    console.log(data.response);
    })
  .fail(function (data) {
    console.log(data.error);
    })

Keywords

FAQs

Package last updated on 05 Apr 2015

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