Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@structure-codes/utils

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@structure-codes/utils

A library containing utilities to convert tree structures between JSON and string formats

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

This repo contains the tree parsing functions which are used in multiple repos throughout the project.

treeStringToJson

This parses a tree output into JSON for further use. Sample JSON format is below. Node names are stored in the keys and children are stored as an object in the value.

[
  {
    "name": "AboutView",
    "children": [],
  },
  {
    "name": "App",
    "children": [
      {
        "name": "Header",
        "children": [
          {
            "name": "index.tsx",
            "children": [],
          }
        ]
      },
      {
        "name": "index.tsx",
        "children": [],
      },
      {
        "name": "style.ts",
        "children": [],
      }
    ]
  }
]

treeJsonToString

This is used to convert the JSON back to a formatted string for logging or storing in a file.

├── AboutView
└── App
  ├── Header
  │  └── index.tsx
  ├── index.tsx
  └── style.ts

FAQs

Package last updated on 06 Mar 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

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