Skip to content

Provides an API for easily transforming Delphi Forms

License

Notifications You must be signed in to change notification settings

spiltcoffee/postdfm

Repository files navigation

postdfm

Process over Delphi Forms (.dfm) files via an AST.

Inspired by the excellent PostCSS tool, motivated by my rage at the Delphi IDE.

npm: @postdfm/dfm2ast CircleCI branch Codecov branch Greenkeeper

Table of Contents

Installation

The postdfm project is an interface wrapping all the separate modules together.

# npm
$ npm install postdfm

# yarn
$ yarn add postdfm

Example Usage

const fs = require("fs");
const postdfm = require("postdfm");

const cisDfm = fs.readFileSync(
  "cis.dfm",
  //.dfm files tend to be ascii instead of utf8
  "ascii"
);

const runner = postcss({
  transformers: [
    function(ast) {
      //transform and return the ast
      return transformedAst;
    }
  ]
});

const transDfm = runner.processSync(dfm, {
  //filename used for reporting errors
  from: "cis.dfm"
});

fs.writeFileSync("trans.dfm", transDfm);

See the postdfm README.md for more information.

Contributing

Bug reports and feature requests are greatly appreciated, as are pull requests.

Please see the Contributing Guide for instructions on how to contribute to this project.

License

Licensed under the MIT License.