New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ezs/basics

Package Overview
Dependencies
Maintainers
2
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ezs/basics

Basics statements for EZS

  • 1.4.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
239
decreased by-49.26%
Maintainers
2
Weekly downloads
 
Created
Source

basics

Ce plugin propose une série d'instructions transformer plusieurs formats text (xml, json, cvs, etc.) en flux d'objets Javascript

installation

npm install @ezs/basics

usage

Table of Contents

URLConnect

Take Object and send it to an URL the output will be the content of URL

Parameters
  • url String? URL to fecth
  • json String Pasre as JSON the content of URL (optional, default false)

Returns Object

URLStream

Take Object as parameters of URL, throw each chunk from the result

Parameters
  • url String? URL to fecth
  • path String choose the path to split JSON result (optional, default *)
  • timeout String Timeout for each request (milliseconds) (optional, default 1000)

Returns Object

OBJCount

Take Object and count how many objects are received and sent the total

Parameters

Returns Number

URLFetch

Take Object and create a new field with the content of URL. Or if no target will be specified, the output will be the content of URL

Parameters
  • url String? URL to fecth
  • target String? choose the key to set
  • json String Pasre as JSON the content of URL (optional, default false)
  • timeout String Timeout for each request (milliseconds) (optional, default 1000)

Returns Object

URLParse

Take String of URL, parse it and returns Object

Returns Object

URLString

Take Object representing a URL and stringify it

Returns String

BUFObject

Take Mixed and produce Buffer. For example, it's useful to send string to browser.

Parameters

Returns Buffer

TXTObject

Take String and generate an object with a key and a value, where the value is the input string.

Parameters
  • key String choose a the key name (optional, default value)

Returns Object

TXTConcat

Take String and concat all items in just one string

Parameters

Returns String

ZIPExtract

Take the content of a zip file, extract some files, and yield JSON. By default, files are scanned as JSON files. The JSON object is sent to the output stream for each file. If JSON option is disabled, it returns to the output stream an object for each file found like :

{ id: file name, value: file contents, }

Parameters
  • path Boolean Regex to select the files to extract (optional, default "**\/*.json")
  • json Boolean transforms each file into an Object (JSON) (optional, default true)

Returns any

OBJFlatten

Take Object and flat it with delimited character.

Parameters
  • separator String choose a character for flatten keys (optional, default /)
  • safe Boolean preserve arrays and their contents, (optional, default false)

Returns Object

INIString

Take Object and generate INI

Returns String

CSVParse

Take String and parse CSV to generate object

Parameters
  • separator String to indicate the CSV separator (optional, default auto)
  • quote String to indicate the CSV quote. (optional, default auto)

Returns Object

XMLString

Take Object and transform it into a XML string

Parameters
  • rootElement String Root element name for the tag which start and close the feed (optional, default items)
  • contentElement String Content element name for the tag which start and close each item (optional, default item)
  • rootNamespace String? Namespace for the root tag (xmlns=)

Returns String

JSONParse

Take String and parse JSON and generate objects

Parameters
  • separator String to split at every JSONPath found (optional, default *)

Returns Object

TXTZip

Take a String and zip it

Returns Buffer

JSONString

Take Object and generate JSON

Parameters
  • wrap String every document are wrapped into an array (optional, default true)
  • indent String indent JSON (optional, default false)

Returns String

XMLParse

Take String as XML input, parse it and split it in multi document at each path found

Parameters
  • separator String choose a character for flatten keys (optional, default /)

Returns Object

TXTParse

Take String and split at each separator found

Parameters
  • separator String choose character which trigger the split (optional, default "\n")

Returns String

CSVString

Take Object and transform row into string where each field is separated with a character

Parameters
  • format String if set to "strict" the fields will wrapped with double quote (optional, default standard)
  • separator String to indicate the CSV separator (optional, default ;)
  • header Boolean first line contains key name (optional, default true)

Returns String

CSVObject

Take Array and transform rows into object. Each row (Array) is tranformed into a object where keys are the value of the first row

Parameters

Returns Object

OBJStandardize

Take Object and standardize it so each object will have the sames keys

Parameters

Returns Object

Keywords

FAQs

Package last updated on 27 Jul 2020

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