Registry / testing / idf-formatter

idf-formatter

JSON →
library1.1.3jsnpmunverified

A formatter engine for EnergyPlus Input Data File (IDF) format. Current stable version is 1.1.3. Release cadence is irregular. Key differentiator: it is a dedicated formatter for EnergyPlus IDF files, supporting customizable indentation, comment column padding, and empty lines between entries. It is a small, focused library with no external dependencies.

npm install idf-formatter
INSTALL
IMPORT
SIG · IDF-FORMATTER
I
idf-formatter
testingjavascriptv1.1.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

formatIDF
import { formatIDF } from 'idf-formatter'
const formatIDF = require('idf-formatter')
ESM-only package; CommonJS require will fail.
default import
import { formatIDF } from 'idf-formatter'
import formatIDF from 'idf-formatter'
Only named export is available; default import is invalid.
type import
import type { IDirectory } from 'idf-formatter'
No types are exported from this package; type imports are not applicable.

Formats an IDF text with custom indentation, comment padding, and empty lines between entries.

import { formatIDF } from 'idf-formatter'; const idfText = ` Version,9.0; Building,Example Building; `; const formatted = formatIDF(idfText, { indentation: 4, commentColumnPadding: 30, emptyLinesBetweenEntries: 1 }); console.log(formatted);
Debug
Known issues
gotchaThe package is ESM-only; using require() will throw a runtime error.
fix
Use import syntax or dynamic import.
affects: >=1.0.0
gotchaOnly named export formatIDF is available; default import does not exist.
fix
Use named import: import { formatIDF } from 'idf-formatter'.
affects: >=1.0.0
gotchaOptions object properties must be numbers; strings will cause unexpected behavior.
fix
Always pass numbers for indentation, commentColumnPadding, and emptyLinesBetweenEntries.
affects: >=1.0.0
Errors
Common errors & fixes
SyntaxError: Cannot use import statement outside a module
Using ESM import in a CommonJS environment without proper configuration.
fix
Add 'type': 'module' to your package.json, or use dynamic import: const { formatIDF } = await import('idf-formatter');
TypeError: formatIDF is not a function
Attempting to call formatIDF as a default import or using require incorrectly.
fix
Ensure correct import: import { formatIDF } from 'idf-formatter';
Upgrade
Version history
1.1.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
idf-formatter — npm install idf-formatter · libregistry