metaschema
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -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); | ||
} |
'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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10408
10
142
38
+ Addedmetarhia-common@0.0.19(transitive)
- Removedmetarhia-common@0.0.15(transitive)
Updatedmetarhia-common@^0.0.19