Skip to content

simhaonline/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.

CircleCI branch Codecov branch Known Vulnerabilities

Table of Contents

Packages

Package Version
postdfm npm
@postdfm/ast npm
@postdfm/ast2dfm npm
@postdfm/dfm2ast npm

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 = postdfm({
  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 package 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.

About

Provides an API for easily transforming Delphi Forms

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 65.8%
  • Nearley 15.3%
  • Pascal 9.8%
  • JavaScript 9.1%