🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

moralis-plugins

Package Overview
Dependencies
Maintainers
7
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

moralis-plugins

![logo](logo.png)

1.1.26
latest
npm
Version published
Weekly downloads
20
Maintainers
7
Weekly downloads
 
Created
Source

logo

Moralis Plugins

Code generation for Moralis Plugins

npm install moralis-plugins --global

Create Plugin

moralis-plugins create greetings
cd greetings

Develop Plugin

greetings/src/index.ts

import Moralis from 'moralis-plugins'

const plugin = new Moralis.Plugin({
  name: 'Greetings',
  description: 'Example greeting plugin',
  version: '1.0.0',
})

plugin.define<{ name: string }>(
  'hello/:name',
  req => {
    const a = `Hello, ${req.params.name}`
    return a
  },
  {
    description: 'Returns a hello greeting',
    returnDescription: 'A hello greeting',
  }
)

export default plugin

Build Plugin

moralis-plugins build

Should receive output as follows

Plugin saved to dist
Swagger saved to swagger.yml
Client saved to client

Run Plugin Locally

moralis-plugins serve

Should receive output as follows

Plugin saved to dist
OpenApi Docs at http://localhost:8080/api-docs

Result

FAQs

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