https://github.com/artskydj/cfdump
A speedy alternative to ColdFusion's <cfdump> tag
https://github.com/artskydj/cfdump
Last synced: about 1 month ago
JSON representation
A speedy alternative to ColdFusion's <cfdump> tag
- Host: GitHub
- URL: https://github.com/artskydj/cfdump
- Owner: ArtskydJ
- Created: 2017-12-14T22:04:48.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-14T22:32:35.000Z (over 8 years ago)
- Last Synced: 2025-03-12T05:29:52.441Z (about 1 year ago)
- Language: ColdFusion
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cfdump
A speedy alternative to ColdFusion's `` tag
## usage
```html
#new cfdump(myVar)#
#new cfdump(myVar, { expand = false })#
```
## api
### `var html = cfdump(variable, [options])`
- `variable` *any* **required** An array, struct, query, or a simple value to dump
- `options` *struct* **optional**
- `expand` *boolean* **optional** Expanded view (defaults to true)
- `sort` *boolean* **optional** Sort the query column names (defaults to true)
- **Returns** `html` *string*
## speed
The main reason for this project is that `` can be ridiculously slow.
This is easily 100x faster than `` on mid/large queries.
I have not yet tested the time difference for arrays and structs.
I tested the time difference with a query of 52 columns and 25 rows.
| code | usual time range | spiked up to |
|------------------------|------------------|--------------|
| `` |2400 ms - 2900 ms | 3800 ms |
| `#new cfdump(qry)#` | 3 ms - 7 ms | 40 ms |
I haven't tested the latest version, which added some functionality, but I expect the difference is trivial.
# license
[MIT](https://choosealicense.com/licenses/mit/)