New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

mapit

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mapit

Add some sugar to a commonly used pattern

latest
Source
npmnpm
Version
0.0.21
Version published
Maintainers
1
Created
Source

mapit

Are you tired of doing this?

var app = express();

app.set('abc', 'xyz');
app.set('foo', true);
app.set('bar', {});

With mapit, you can do this:

var app = express();
var mapit = require('mapit');

app.mapit(app.set, {
  'abc': 'xyz',
  'foo': true,
  'bar': {}
});

It works with anything:

app.mapit(app.get, {
  '/': function (req, res) {
    res.send('hello');
  },
  '/hello': function (req, res) {
    res.send('world');
  }
});

You can even use it like this:

// It doesn't have to be app.mapit
mapit(app.set, {
  'abc': 'xyz'
}, app);

Note: express was just an example. mapit works everywhere.

Installation

node

Install with npm:

$ npm install --save mapit

browser

bower:

$ bower install --save mapit

Or just put mapit.js in a script tag.

License

MIT License. See ./LICENSE for details.

Keywords

utility

FAQs

Package last updated on 10 Oct 2014

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