noapi-definejs-converter
v1.0.2
Published
Convert the api definitions of [Noapi](https://github.com/hiowenluke/noapi) app between three modes: array, object, file. Noapi is a light API framework for [Node.js](https://nodejs.org), easily define api and test case, easily I/O. You can focus on the b
Downloads
2
Readme
Noapi DefineJs Converter
Convert the api definitions of Noapi app between three modes: array, object, file. Noapi is a light API framework for Node.js, easily define api and test case, easily I/O. You can focus on the business code, no need to care about how to manage api services, web service, routes, test cases, etc., improve your efficiency, save your time.
Installation
npm i noapi-definejs-converter --save
Usage
// /path/to/your/project/tools/convert.js
const converter = require('noapi-definejs-converter');
const options = {
apiPath: './demo-app/api',
// Three modes: "array" / "object" / "file",
// If omitted, the inverse of source type is used:
// If the source type is "object", then the target type will be "array";
// If the source type is "array", then the target type will be "object".
targetType: '',
};
// Do convert.
// The original define.js file or sub directories will be backed up to the api.bak directory.
converter(options);
Test
git clone https://github.com/hiowenluke/noapi-definejs-converter
cd noapi-definejs-converter
npm test
License
Copyright (c) 2019, Owen Luke