Socket
Socket
Sign inDemoInstall

plutonio

Package Overview
Dependencies
33
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

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.


Version published
Maintainers
1
Install size
31.6 MB
Created

Readme

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 = {
    name: string;
    category: Category;
    type: Primitive;
    original?: string;
    enum?: string[];
    imports: Import[];
    properties?: {
        [k:string]: Schema
    }
};

type Category = 'type' | 'interface';

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

An example of a schema is the following:

const schema = {
    name: 'Product',
    category: 'interface',
    type: 'object',
    original: 'export interface Product extends Foo.Boo {title: string, price: number}',
    properties: {
        title: {
            type: 'string',
        },
        price: {
            type: 'number',
        },
    },
    imports: [
        {
            text: 'import Foo from "foo"',
            module: 'foo',
            clause: 'Foo',
            specifiers: [],
        },
    ],
},
};

FAQs

Last updated on 24 Jan 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc