Socket
Socket
Sign inDemoInstall

flattie

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

flattie

A tiny (203B) and fast utility to flatten an object with customizable glue


Version published
Weekly downloads
308K
increased by1.79%
Maintainers
1
Weekly downloads
 
Created

What is flattie?

The flattie npm package is a utility for flattening and unflattening nested objects. It is useful for transforming complex nested structures into simpler key-value pairs and vice versa.

What are flattie's main functionalities?

Flattening Objects

This feature allows you to convert a nested object into a flat object with dot-separated keys.

const flattie = require('flattie');
const nestedObject = { a: { b: { c: 1 } }, d: 2 };
const flatObject = flattie(nestedObject);
console.log(flatObject); // { 'a.b.c': 1, d: 2 }

Unflattening Objects

This feature allows you to convert a flat object with dot-separated keys back into a nested object.

const flattie = require('flattie');
const flatObject = { 'a.b.c': 1, d: 2 };
const nestedObject = flattie.unflatten(flatObject);
console.log(nestedObject); // { a: { b: { c: 1 } }, d: 2 }

Other packages similar to flattie

Keywords

FAQs

Package last updated on 09 Sep 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