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 Mar 20, 2024 via pnpm

flat 0.0.2

Take a nested Javascript object and flatten it, or unflatten an object with delimited keys
Package summary
Share
4
issues
2
critical severity
vulnerability
2
1
high severity
license
1
1
low severity
license
1
1
license
1
BSD
Package created
5 Oct 2012
Version published
6 Oct 2012
Maintainers
3
Total deps
1
Direct deps
0
License
BSD

Issues

4

2 critical severity issues

critical
Recommendation: Upgrade to version 5.0.1 or later
via: flat@0.0.2
Recommendation: Upgrade to version 5.0.1 or later
via: flat@0.0.2
Collapse
Expand

1 high severity issue

high
Recommendation: Validate that the package complies with your license policy
via: flat@0.0.2
Collapse
Expand

1 low severity issue

low
Recommendation: Read and validate the license terms
via: flat@0.0.2
Collapse
Expand

Licenses

BSD

Invalid
Not OSI Approved
1 Packages, Including:
flat@0.0.2
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

0
All Dependencies CSV
β“˜ This is a list of flat 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does flat do?

Flat is a powerful JavaScript library that provides a simple way to flatten and unflatten deeply nested objects. This capability can simplify complex nested structures into a single-level object representation, or vice versa. This functionality proves especially useful when handling complex JSON objects or building data transformation pipelines in JavaScript.

How do you use flat?

You can use the flat library in a JavaScript project by first installing it with npm using npm install flat. After installation, you can import the flatten and unflatten functions from it.

Below are example usages:

Flattening an object:

import { flatten } from 'flat'

const result = flatten({
    key1: {
        keyA: 'valueI'
    },
    key2: {
        keyB: 'valueII'
    },
    key3: { a: { b: { c: 2 } } }
})

console.log(result);
// Outputs: { 'key1.keyA': 'valueI', 'key2.keyB': 'valueII', 'key3.a.b.c': 2 }

Unflattening an object:

import { unflatten } from 'flat'

const result = unflatten({
    'three.levels.deep': 42,
    'three.levels': {
        nested: true
    }
})

console.log(result);
// Outputs: { three: { levels: { deep: 42, nested: true } } }

Where are the flat docs?

The official documentation for flat can be found in the README file of its GitHub repository. Here you can find comprehensive details on installation, usage, options for customization, and examples. You can also learn about its command-line usage for directly dealing with JSON files.