0.1.4 ā€¢ Published 3 years ago

tyfon-conventions v0.1.4

Weekly downloads
11
License
MIT
Repository
github
Last release
3 years ago

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'
// > }