This package has been deprecated

Author message:

Moved to @hoast/hoast.

hoast-transform

1.1.2 • Public • Published

npm package @latest npm package @next

Travis-ci status CodeCov coverage

License agreement Open issues on GitHub

hoast-transform

Transform the content of files based on the extension.

As the name suggest this is a hoast module. The module has been based of metalsmith-in-place.

Usage

Install hoast-transform using npm.

$ npm install hoast-transform

Parameters

  • options: Options given to the JSTransformer.
    • Type: Object
      • Default: {}
  • patterns: Glob patterns to match file paths with. If the engine function is set it will only give the function any files matching the pattern.
    • Type: String or Array of strings
      • Required: no
  • patternOptions: Options for the glob pattern matching. See planckmatch options for more details on the pattern options.
    • Type: Object
    • Default: {}
  • patternOptions.all: This options is added to patternOptions, and determines whether all patterns need to match instead of only one.
    • Type: Boolean
    • Default: false

Example

CLI

{
  "modules": {
    "read": {},
    "hoast-transform": {
      "patterns": "*.md"
    }
  }
}

Script

const Hoast = require(`hoast`);
const read = Hoast.read,
      transform = require(`hoast-transform`);
 
Hoast(__dirname)
  .use(read())
  .use(transform({
    patterns: `*.md`
  }))
  .process();

In the examples the markdown files will be transformed to HTML.

Troubleshooting

If you are having problems with the module please enable debugging to have a closer look.

File not valid for processing.

  • The file is not utf-8 encoded.
  • The file path does not match any of the patterns.

No valid transformer found for extension .

  • Check if the JSTransformer associated with the extension is installed.

Package Sidebar

Install

npm i hoast-transform

Weekly Downloads

1

Version

1.1.2

License

ISC

Unpacked Size

9.39 kB

Total Files

5

Last publish

Collaborators

  • redkenrok