1.0.0 • Published 7 years ago

try-for-node v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

TRY FOR nodejs

Analog of the 'try' method in Ruby

Installation

npm install try-for-node

Usage

import { tryable } from 'try-for-node'

const someObj = {
  someMethod() {
    return this
  }
};

tryable(someObj).try('someMethod').try('someMethod').try('fakeMethod').try('fake')

Output should be null

Tests

npm test

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.