Process over Delphi Forms (.dfm) files via an AST.
Inspired by the excellent PostCSS tool, motivated by my rage at the Delphi IDE.
The postdfm
project is an interface wrapping all the separate modules together.
# npm
$ npm install postdfm
# yarn
$ yarn add postdfm
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.
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.
Licensed under the MIT License.