You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

sails-js-parser

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sails-js-parser

Sails-IDL parser for TypeScript

0.4.2
latest
npmnpm
Version published
Weekly downloads
298
24.17%
Maintainers
1
Weekly downloads
 
Created
Source

Overview

The sails-js-parser is designed to parse Sails IDL files, producing an output that can be used to generate client libraries or facilitate interaction with Gear blockchain programs.

Installation

To install the sails-js-parser library:

npm install sails-js-parser

Usage

Initialization

import { SailsIdlParser } from 'sails-js-parser';

const parser = await SailsIdlParser.new();

Often used with sails-js:

import { Sails } from 'sails-js';
import { SailsIdlParser } from 'sails-js-parser';

const parser = await SailsIdlParser.new();
const sails = new Sails(parser);

Parsing

const idl = `
  constructor {
    New : ();
  };

  service SailsApp {
    DoSomething : () -> str;
  };
`
const program = parser.parse(idl);

The parse method returns a Program instance representing the parsed IDL.

Keywords

gear

FAQs

Package last updated on 23 May 2025

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