0.1.4 ā¢ Published 3 years ago
tyfon-conventions v0.1.4
tyfon-conventions
TyFON conventions for mapping functions to URL endpoints.
š Read this for more information.
Installation
npm i tyfon-conventions
Usage
š Find possible names from an invoked URL:
import { possibleNames } from 'tyfon-conventions';
console.log(possibleNames({
method: 'POST',
url: 'something'
});
// > something, postSomething, createSomething, addSomething
š Find URL and http method for a function name:
import { endpoint } from 'tyfon-conventions';
console.log(endpoint('postSomething'));
// > {
// > method: 'POST',
// > url: 'something'
// > }