New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

leancloud-auto

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leancloud-auto

Automatically generate LeanCloud classes and docs from schema definition.

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

leancloud-auto

Automatically generate LeanCloud classes and docs from schema definition. Which make it easy to migrate to LeanCloud from other data source.

中文

Install

# use yarn
$ yarn global add leancloud-auto
# or use npm
$ npm install -g leancloud-auto

Usage

There are something that to be explained firstly, the following docs use the keywords Schema and Class, which are both referred to LeanCloud Class. It is called Class in cloud, while called Schema at local.

Generate classes from a local schema file

leanauto init -i appId -k appKey -m masterKey ./schema.json

This command will first create some classes which defined in file schema.json. Then compare the generated schema with the local schema and tell you whether they are perfectly matched.

Feel free to use this command, it would not delete your original schema or data. But you should make sure that the same schema not exists when runing this command, otherwise your original schema would be dirted.

Generate docs from local schemas or cloud schemas

# from cloud schema
leanauto doc -i appId -k appKey -m masterKey -o ./structure.html

# from local schema
leanauto doc ./schema.json -o ./structure.html

This command will generate documents of the specified schema, representing as HTML tables. Open it in browser then have a look.

If not specify the -o option, it will print the markdown style string in terminal instead of writing to a HTML file.

Generate GraphQL language schema

leanauto graphql ./schema.json -d ./graphql

This command will generate some files named {{className}}.js, which could simply integrate with GraphQL by another tool egg-graphql.

Test

See test/test.js.

FAQs

Package last updated on 08 Apr 2018

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