partial-left

0.1.1 • Public • Published

partial-left NPM version

Returns a function with partially applied arguments that are prepended to the arguments provided to the returned function.

Install

Install with npm

$ npm i partial-left --save

Usage

var partial = require('partial-left');

function resolve(dir, filename) {
  return path.join.apply(path, [].slice.call(arguments));
}

var fn = partial(resolve, 'site', 'blog', 'posts');

fn('index.html')
//=> 'site/blog/posts/index.html'

fn('home.html')
//=> 'site/blog/posts/home.html'

fn('about.html')
//=> 'site/blog/posts/about.html'

Related projects

partial-right: Returns a function with partially applied arguments that are appended to the arguments provided to… more

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on July 13, 2015.

Package Sidebar

Install

npm i partial-left

Weekly Downloads

0

Version

0.1.1

License

MIT

Last publish

Collaborators

  • jonschlinkert