New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

nvp-accessor

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

nvp-accessor

Simple module to access name-value pairs in an object

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

nvp-accessor

Author : Mike Amundsen (@mamund)

module constructor

  message = {};
  nameValuePair = "_nvp";

  const accessor = require('./nvp-accessor')()
  const accessor = require('./nvp-accessor')({message:m})
  const accessor = require('./nvp-accessor')({message:m, nameValuePair:p})

initialize the accessor

  message = {}
  nameValuePair = "_nvp"
 
  accessor.init({message:m,nameValuePair:p})

return the preloaded message for this instance

  accessor.message();

gather a set of properties from the message

  c = ['field1','field2',...] 
   
  accessor.gather({collection:c})
  accessor.gather({collection:c, message:m})
  accessor.gather({collection:c, message,:m nameValuePair:p})

find a single property's value

  name = 'fieldName';
  message = {};
  nameValuePair = "_nvp";
   
  accessor.find({name:n})
  accessor.find({name:n, message:m})
  accessor.find({name:n, message:m, nameValuePair:n})

shortcuts for functions

 accessor.i <== alias for init
 accessor.g <== alias for gather
 accessor.f <== alias for find
 accessor.m <== alias for message

FAQs

Package last updated on 27 Mar 2021

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