Skip to content

bendrucker/poison-get

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

poison-get Build Status Greenkeeper badge

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages