Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@janiscommerce/active-client

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@janiscommerce/active-client

A simple module for getting an Active Client from a field and a value

  • 1.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by400%
Maintainers
1
Weekly downloads
 
Created
Source

active-client

Build Status Coverage Status

ActiveClient is a simple module for getting an Active Client from a field and a value. The module only has one method and a Model for the get.

Installation

npm install @janiscommerce/active-client

Settings

This package uses the Settings package for handle settings. The setting key is clients and the available settings are the following

SettingDefault ValueDescription
databaseKey_defaultThe database key from DB configuration
tableclientsThe clients table name

API

  • getByField(field, value) ASYNCHRONOUS, Search the client by a field and value given.
  • field: type String, the field name. eg. 'name'.
  • value: type String|Integer, the field value. eg. 'foo'.

Returns a Object with the client found or false if client not found for field with that value.

Usage


const ActiveClient = require('@janiscommerce/active-client');

const client = await ActiveClient.getByField('name', 'client-name');

/**
	Expected output:
	{
		id: 1,
		name: 'client-name',
		status: 5
	}
 */

FAQs

Package last updated on 06 Aug 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc