🚀 Big News:Socket Has Acquired Secure Annex.Learn More
Socket
Book a DemoSign in
Socket

@novigi/util

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@novigi/util

A module containing common javascript util methods ✨

unpublished
latest
npmnpm
Version
0.0.5
Version published
Maintainers
1
Created
Source

npm (scoped) NPM Statements Branches Functions Lines

@novigi/util

A module containing common javascript util methods ✨

📦 Getting Started

  • Install the dependency
npm install @novigi/util
  • Import the library
const lib = require('@novigi/util');

📖 Documentation

util

A module containing common javascript util methods.

const util = require('@novigi/util');

util.to_base64(input) ⇒ string

Converts any object to base64 string representation

Kind: static method of util
Returns: string - Base64 string representation of the input

ParamTypeDescription
inputobject | stringInput reqired to be converted to base64

Example

// returns dGVzdA==
const util = require('@novigi/util');
util.to_base64('test');

util.json_to_xml(json, rootElement) ⇒ string

Converts a js object or valid JSON string to xml

Kind: static method of util
Returns: string - xml representation of the input JSON string or js object

ParamTypeDescription
jsonobject | stringJavascript object or JSON string
rootElementstringOptional string to provide as the root element

Example

// returns <?xml version='1.0'?>
//         <root>
//           <test>1</test>
//         </root>
const util = require('@novigi/util');
util.json_to_xml({ test: 1 }, 'root');

util.xml_to_json(xml) ⇒ string

Converts a XML string to a JSON string

Kind: static method of util
Returns: string - JSON string representation of the xml input

ParamTypeDescription
xmlstringXML string

Example

// returns "{\"x\":{\"test\":{\"_text\":\"1\"}}}"
const util = require('nov-nodejs-core-util');
util.xml_to_json("<x><test>1</test></x>");

This is an auto generated file. Please don't make changes manually

FAQs

Package last updated on 05 Oct 2022

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