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

metaschema

Package Overview
Dependencies
Maintainers
1
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metaschema - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

lib/generator.js

12

bin/cli.js

@@ -9,3 +9,8 @@ #!/usr/bin/env node

const metaschema = require('metaschema');
let metaschema;
try {
metaschema = require('metaschema');
} catch (e) {
metaschema = require('..');
}

@@ -17,3 +22,5 @@ const cwd = process.cwd();

const imports = require(apiFile);
const md = metaschema.generate('api.interfaceName', imports);
const namespace = path.basename(apiFile, '.js');
const inventory = metaschema.introspect({ [namespace]: imports });
const md = metaschema.generateMd(inventory);
const mdFile = common.removeExt(apiFile) + '.md';

@@ -27,2 +34,3 @@

console.log('Cant read file: ' + apiFile);
console.log(e);
}

7

metaschema.js
'use strict';
const generate = require('./lib/generate');
const introspection = require('./lib/introspection');
const generator = require('./lib/generator');
module.exports = {
generate
};
module.exports = Object.assign({}, introspection, generator);
{
"name": "metaschema",
"version": "0.0.3",
"version": "0.0.4",
"author": "Timur Shemsedinov <timur.shemsedinov@gmail.com>",

@@ -26,3 +26,3 @@ "description": "Metadata Schema and Interface Definition Language (IDL)",

"scripts": {
"test": "npm run lint",
"test": "npm run lint && ./bin/cli.js ./metaschema.js",
"lint": "eslint ."

@@ -34,3 +34,3 @@ },

"dependencies": {
"metarhia-common": "^0.0.15"
"metarhia-common": "^0.0.19"
},

@@ -37,0 +37,0 @@ "devDependencies": {

@@ -17,2 +17,19 @@ # metaschema

## Interface: metaschema
### Introspect interface
`metaschema.introspect(namespace)`
- `namespace:hash of interfaces`
Returns: hash of hash of record, { method, title, parameters }
### Parse function signature
`metaschema.parseSignature(fn)`
- `fn:function` - method
Returns: { title, parameters }
### Generate md from interfaces inventory
`metaschema.generateMd(inventory)`
- `inventory:hash of hash of record` - { method, title, parameters }
Returns: string, md document
## Contributors

@@ -19,0 +36,0 @@

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