1.0.0 • Published 9 years ago

poison-get v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

poison-get Build Status

Throw when a user attempts to access specified properties in an object

Install

$ npm install --save poison-get

Usage

var poison = require('poison-get')

var obj = poison({}, 'foo')
obj.foo
//=> throws Error

API

poison(obj, keys, [message]) -> object

obj

Required
Type: object

An object to modify with poison getters.

keys

Required
Type: string / array[string]

The key (or keys) where poison getters will be assigned.

message

Type: string

An error message to use when throwing

License

MIT © Ben Drucker