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

plutonio

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

plutonio

A typescript library that scans your typescript project and generate a schema of all types and interfaces of the project.

  • 1.0.2
  • unpublished
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

Plutonio

Plutonio is a Typescript library that scans your typescript project and generate a schema of all types and interfaces of the project.

The schema is the following:

type Schema = {
  [file_path: string]: {
    imports?: Import[];
    interfaces?: {
      [name: string]: {
        extends: string[];
        full_text: string;
        properties: Properties;
        type: Primitive;
      };
    };
    types?: {
      [name: string]: {
        full_text: string;
        properties: Properties;
        type: Primitive;
      };
    };
  };
};

type Import = {
  clause: string;
  module: string;
  specifiers: string[];
  text: string;
};

type Properties = {
  [k: string]: {
    enum?: string[];
    original?: string;
    properties?: Properties;
    type: Primitive;
  };
};

type Primitive =
  | 'any';
  | 'boolean'
  | 'null'
  | 'number'
  | 'object'
  | 'string'
  | 'undefined'

An example of a schema is the following:

const schema = {
  'src/index.ts': {
    interfaces: {
      Product: {
        full_text:
          'export interface Product extends Foo.Boo {title: string, price: number}',
        properties: {
          title: {
            type: 'string',
          },
          price: {
            type: 'number',
          },
        },
        type: 'object',
      },
    },
    imports: [
      {
        text: 'import Foo from "foo"',
        module: 'foo',
        clause: 'Foo',
        specifiers: [],
      },
    ],
  },
};

FAQs

Package last updated on 30 Oct 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