A modular ES module to scan file contents and pull structured line details with capture variables using regular expressions.
pattern-collector-anyjs-storyImagine you have a large Express.js project with multiple versions, tables, and hundreds of API endpoints.
Every time you create a new API, you have to open several routing files and manually update them before your API becomes available.
import statement.router.use() entry.router.get(), router.post(), router.put() or
router.delete() method.
As your project grows, this process becomes repetitive, time-consuming, and increases the chance of making mistakes.
Add the pattern collector to your Node.js project using npm or yarn:
npm install pattern-collector-anyjs-story
Or using yarn:
yarn add pattern-collector-anyjs-story
Import the default function and pass your code text along with your configuration template name:
import collectPatternStory from 'pattern-collector-anyjs-story';
const results = collectPatternStory({
fileContent: sourceCode,
fileType: 'fromEndPointsJs'
});
This repository is built as a composition of modular sub-packages: