Socket
Book a DemoInstallSign in
Socket

strict-attributes

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strict-attributes

Converts a plain object into an object that throws error on try to read attributes that does not exist.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

strict-attributes

Converts a plain object into an object that throws an error on try to read attributes that does not exist.

Example

// Port value will be "undefined" if environment variable not set and program will continue to run.
const port = process.env.PORT;
const strict = require('strict-attributes');

// Exception will be thrown if environment variable not set.
const port = strict(process.env).PORT; 

Keywords

object

FAQs

Package last updated on 09 Feb 2018

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