@cguevara/filejutsu
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

Filejutsu

Filejutsu is an experimental tool for generating files and directory structures inspired by Next.js. Filejutsu can be used for various tasks such as:

  • Code generation
  • Static HTML/CSS/JS generation

How Filejutsu Works

The `template/` directory contains template files (files that end in `__.js`). Filejutsu converts these template files into actual files.

For example, a template file named `index.html__.js` will be converted into `index.html`.

Each template file is an ES module that exports the following functions:

  • `export default function(props) {...}` - The default export is a function that returns the file's contents.
  • `export async getProps(context) {...}` - (optional) `getProps` is an async function that returns the props, which will be passed to the default function.
  • `export async getPaths(context) {...}` - (optional) `getPaths` is an async function that returns the path parameters for dynamic filenames. TODO Explain this in more detail and include an example.

Readme

Keywords

none

Package Sidebar

Install

npm i @cguevara/filejutsu

Weekly Downloads

3

Version

0.0.8

License

ISC

Unpacked Size

9.07 kB

Total Files

10

Last publish

Collaborators

  • cguevara