api-name-finder

0.1.6 • Public • Published

api-name-finder

api-name-finder help users to fetch all API name from specified file.

Installation

npm install api-name-finder

Quick Start

api-name-finder modules is very easy to get start and find all api lists. This modules helps to read API files(specified by user) and fetch all APIs. This modules has 2 basic functions which helps to retrieve API lists and save them in file.

1.getAPIs function read and filter APIs from specified filesand returns a lists of APIs in json object. This function take 3 parameters: fileNames, filters and callback function.

Usage:

apiFinder.getAPIs(filename, filter, function(err, lists){
    if(err)
        console.log(err);

    console.dir(lists);
});

filename: File name can be a single file or array of files. filter: Filter APIs lists. filter ca be a string or array of string. callback: a function that can hold err and apiLists.

2.getAndSaveAPIs function is same as getAPIs function and it help to save all api lists in file.

Usage:

apiFinder.getAndSaveAPIs(filename, "saveAPIList.txt", filterArray, function(err, isDataSaved){
    if(err)
        console.log(err)

    if(isDataSaved)
        console.log("Data saved successfully!");
});
});

Example for reference

var apiFinder = require("api-name-finder");

var fileArray = ["add your API filename"];
var filterArray = ["Add your filter"];
apiFinder.getAPIs(fileArray, filterArray, function(err, lists){
    if(err)
        console.log(err);

    console.dir(lists);
});
apiFinder.getAndSaveAPIs(fileArray, "route.txt", filterArray, function(err, isDataSaved){
    if(err)
        console.log(err)

    if(isDataSaved)
        console.log("Data saved successfully!");
});

Package Sidebar

Install

npm i api-name-finder

Weekly Downloads

3

Version

0.1.6

License

MIT

Last publish

Collaborators

  • n.chejara