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

@liquicode/lib-resource-path

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@liquicode/lib-resource-path

A node library for manipulating a hierarchy of resources using a resource path.

latest
Source
npmnpm
Version
0.0.14
Version published
Maintainers
1
Created
Source

lib-resource-path (v0.0.14)

Getting Started

Install via NPM:

npm install @liquicode/lib-resource-path

Include the library in your source code:

const LibResourcePath = require( '@liquicode/lib-resource-path' );

Simple Usage

const LibResourcePath = require( '@liquicode/lib-resource-path' );

// An array defining three resource nodes.
let Resources =
[
	// Resource Path  :  Resource Value
	".hello"          : { label: 'hello', test: true },
	".hello.world"    : { label: 'world' },
	".koo.bar"        : { label: 'koo bar' },
];

// Get information about a particular resource node.
item = LibResourcePath.Select( Resources, '.hello.world' );
/*
item === {
	path: '.hello.world',
	parent: '.hello',
	name: '.world',
	info: { label: 'world' },
	exists: true,
	resource: { label: 'world', test: true },
	children: [],
}
*/

// Get information about all resources, including implied ones ('.koo') that are not defined.
items = LibResourcePath.Getall( Resources, { item_type: 'info', list_type: 'full', return_type: 'array'} );
/*
items ===
[
	{ path: '.hello', parent: '', name: '.hello', info: { label: 'hello', test: true } },
	{ path: '.hello.world', parent: '.hello', name: '.world', info: { label: 'world' } },
	{ path: '.koo', parent: '', name: '.koo', info: null },
	{ path: '.koo.bar', parent: '.koo', name: '.bar', info: { label: 'koo bar' } },
]
*/

  • Library Source Code
  • Library Docs Site
  • Library NPM Page

Keywords

javascript

FAQs

Package last updated on 09 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