Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 19, 2024 via pnpm

levn 0.4.1

Light ECMAScript (JavaScript) Value Notation - human written, concise, typed, flexible
Package summary
Share
0
issues
1
license
3
MIT
Package created
4 Oct 2013
Version published
4 Apr 2020
Maintainers
1
Total deps
3
Direct deps
2
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
3 Packages, Including:
levn@0.4.1
prelude-ls@1.2.1
type-check@0.4.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

2
All Dependencies CSV
β“˜ This is a list of levn 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
prelude-ls1.2.19.19 kBMIT
prod
type-check0.4.06.62 kBMIT
prod

Visualizations

Frequently Asked Questions

What does levn do?

Levn is a JavaScript library designed for interpreting and validating short strings of human-entered data, transforming those strings into JavaScript values based on anticipated types. It's particularly useful for input taken from configurations files or command line arguments. With its concise and flexible structure, levn offers a more human-friendly, type-specific alternative to JSON.

How do you use levn?

Using levn requires installation via npm, which can be accomplished with the command npm install levn. After installation, you can use levn's parse function to evaluate and type-cast your input strings. For instance, to parse a string into a number, you would use var parse = require('levn').parse; parse('Number', '2');, which outputs 2. You can replace the 'Number' with any expected JavaScript type suited for your needs.

Additionally, levn also comes with a parsedTypeParse function. For this, you first need to parse the type using the parseType function from the "type-check" library. Example usage would be var parsedType = require('type-check').parseType('[Number]'); parsedTypeParse(parsedType, '1,2,3');, which similarly outputs [1, 2, 3].

var parse = require('levn').parse;
parse('Number', '2'); // Outputs: 2

var parsedType = require('type-check').parseType('[Number]');
parsedTypeParse(parsedType, '1,2,3'); // Outputs: [1, 2, 3]

Where are the levn docs?

The levn documentation is primarily located in its Github repository. This includes detailed explanations of how levn operates, examples of use, the list of options you can use with the parsing functions, and technical notes on the library structure and dependencies. An additional description of the type format used by levn is found in the "type-check" library documentation.