https://github.com/foundeo/toscript
Converts Tag based CFML to CFML Script
https://github.com/foundeo/toscript
cfml coldfusion
Last synced: 5 months ago
JSON representation
Converts Tag based CFML to CFML Script
- Host: GitHub
- URL: https://github.com/foundeo/toscript
- Owner: foundeo
- License: gpl-3.0
- Created: 2016-12-09T18:05:29.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-07-29T21:16:25.000Z (almost 5 years ago)
- Last Synced: 2024-03-26T14:32:06.312Z (about 2 years ago)
- Topics: cfml, coldfusion
- Language: ColdFusion
- Size: 41 KB
- Stars: 19
- Watchers: 6
- Forks: 8
- Open Issues: 28
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# toScript()
[](https://github.com/foundeo/toscript/actions/workflows/ci.yml)
Converts tag based CFML code into CFML Script.
## Usage
Invoke the `toScript(filePath="", options={}, fileContent="")` function.
### Options
The `options` struct currently only supports one option `indentChars` which defaults to a tab character. You could pass `{indentChars=" "}` if you wanted to indent with 4 spaces instead of a tabs.
To see an example of how it works look at the unit tests. It converts a Tag Based CFC Test Suite [TagTemplate.cfc](https://github.com/foundeo/toscript/blob/master/tests/tests/TagTemplate.cfc) into a Script CFC test suite [GeneratedScriptCode.cfc](https://github.com/foundeo/toscript/blob/master/tests/tests/GeneratedScriptCode.cfc)
### Example
converter = new ToScript();
result = converter.toScript(filePath="someFile.cfc");
fileWrite("result.cfc", result.code);
## Generated CFML Script
All of the generated script should run on ColdFusion 11+ or Lucee 4.5+
Much of it will also run on older versions of CFML, but it depends on which tags you use.