0.5.0 • Published 4 years ago

templaterator v0.5.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Templaterator

Tool for creating default code templates

How it works?

  npm run file "tsx" "useState useEffect" /PROJECT_PATH/

Example:

  npm run file "tsx" "useState useEffect" /Projects/templaterator/

"tsx" - file or files, ("tsx css js") extension (required).

"useState useEffect" - options for the generated file (optional). Available only for tsx and jsx now.

/Projects/templaterator/ - directory (optional). On default files will be create in root directory of your project.

In directory file is created with name Template and extension tsx or css. useState and useEffect are hooks which will be used in and written to the file.

File contain this code after command:

import React, { useEffect, useState } from 'react';

import styles from './Template.css'

const Template = () => {
  const [stateValue, setStateValue] = useState('');

  useEffect(() => {

  }, [])

  return (
    <div />
  );
}

export default Template;

Works same for .jsx extension.

Which file extensions is supporting?

.jsx, .tsx, .css and .stories.jsx (.stories.tsx of course) are currently supported.

Call how npm module

Add to package.json in your project next npm command:

npm explore templaterator -- npm run file `YOUR_PARAMS`

And it's done!

0.5.0

4 years ago

0.3.2

4 years ago

0.2.1

4 years ago

0.1.1

4 years ago

0.2.2

4 years ago

0.1.0

4 years ago