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

@monokle/parser

Package Overview
Dependencies
Maintainers
5
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@monokle/parser

Kubernetes resource parser

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
increased by125%
Maintainers
5
Weekly downloads
 
Created
Source

Monokle Parser

This package is designed to be used to parse Kubernetes resources.

Usage

The core function is extractK8sResources() function. It accepts a list of file objects:

export type BaseFile = {
  id: string; // unique id
  path: string; // path to source
  content: string; // file content as text
};

BaseFile can represent regular file present in local file storage, but can be also any remote resource or basically anything else (like data read from db). It important to keep in mind that id should be unique.

File objects can be then passed to extractK8sResources() to be parsed. All non K8s-related files will be ignored:

import {extractK8sResources} from `@monokle/parser`;

const resources = extractK8sResources(files);

Each resource contains following information:

{
  id: string;
  fileId: string;
  filePath: string;
  fileOffset: number;
  name: string;
  apiVersion: string;
  kind: string;
  namespace?: string;
  content?: any;
  text: string;
  refs?: ResourceRef[];
  range?: {
    start: number;
    length: number;
  };
}

Keywords

FAQs

Package last updated on 28 Aug 2023

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