npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

epedit.js

v1.0.2

Published

JavaScript library for parsing, editing, and writing EnergyPlus Input Data Files (.idf).

Readme

EPEdit.js is a JavaScript library for parsing, editing, and writing EnergyPlus Input Data Files (.idf).

Features

  • Parse IDF Files: Load .idf file content into a structured object model.
  • Modify IDF: Create, update, or delete any object within the IDF model.
  • Find IDF Objects: Easily find and retrieve objects by their type (e.g., Building, Material) and name.
  • Modify Fields: Get and set values for any field of an IDF object.
  • Universal: Works in both modern web browsers and Node.js environments.
  • Export to IDF: Serialize the modified model back into a valid .idf file string.

Usage

Create a new IDF model

This code create a new IDF model and adds a new Zone object called 'Test Zone'.

import { IDF, IDDManager } from 'epedit.mjs';

async function addZoneExample() {
    const idd = await new IDDManager('./idds').getVersion('23.2');
    let idf = new IDF(idd);
    idf.newObject('Zone', {Name: 'Test Zone'});
    console.log(idf.toString());
}

addZoneExample();
  Zone
    Test Zone,               !- Name
    0,                       !- Direction of Relative North {deg}
    0,                       !- X Origin {m}
    0,                       !- Y Origin {m}
    0,                       !- Z Origin {m}
    1,                       !- Type
    1,                       !- Multiplier
    Autocalculate,           !- Ceiling Height {m}
    Autocalculate,           !- Volume {m3}
    Autocalculate,           !- Floor Area {m2}
    ,                        !- Zone Inside Convection Algorithm
    ,                        !- Zone Outside Convection Algorithm
    Yes;                     !- Part of Total Floor Area

Read, modify, and save an .idf file

This code reads an .idf sting from RefBldgMediumOfficeNew2004_Chicago and iterate through BuildingSurface:Detailed objects to change the Outside Boundary Condition to adiabatic. Finally, it serializes the model back into an .idf file string.

import { IDF, IDDManager } from 'epedit.mjs';
import { idfString } from './idfs/RefBldgMediumOfficeNew2004_Chicago.js';

async function main() {
    console.time('read IDF');
    const idf = await IDF.fromString(idfString, '../idds');
    console.timeEnd('read IDF');
    
    console.time('iterate objects');
    const surfaces = idf.getObjects('BuildingSurface:Detailed');
    for (const surf of surfaces) {
        surf.Outside_Boundary_Condition = 'adiabatic';
    }
    console.timeEnd('iterate objects');
    console.log(`  - num. of total surfaces: ${surfaces.length}`);
    console.log('  - updated surface boundary conditions.');

    console.time('write IDF')
    idf.toString();
    console.timeEnd('write IDF')

    console.log(idf.getObjects('BuildingSurface:Detailed')[10]);
    
    console.log(idf.toString().slice(0, 61));
}

main();
< RefBldgMediumOfficeNew2004_Chicago.idf >

read IDF: 263.925ms

iterate objects: 0.216ms
  - num. of total surfaces: 128
  - updated surface boundary conditions.

write IDF: 9.212ms

{
  Name: 'Core_mid_ZN_5_Wall_South',
  Surface_Type: 'Wall',
  Construction_Name: 'int-walls',
  Zone_Name: 'Core_mid',
  Space_Name: '',
  Outside_Boundary_Condition: 'adiabatic',
  Outside_Boundary_Condition_Object: 'Perimeter_mid_ZN_1_Wall_North',
  Sun_Exposure: 'NoSun',
  Wind_Exposure: 'NoWind',
  View_Factor_to_Ground: 'Autocalculate',
  Number_of_Vertices: '4',
  Vertex_1_Xcoordinate: 4.5732,
  Vertex_1_Ycoordinate: 4.5732,
  Vertex_1_Zcoordinate: 6.7056,
  Vertex_2_Xcoordinate: 4.5732,
  Vertex_2_Ycoordinate: 4.5732,
  Vertex_2_Zcoordinate: 3.9624,
  Vertex_3_Xcoordinate: 45.3375,
  Vertex_3_Ycoordinate: 4.5732,
  Vertex_3_Zcoordinate: 3.9624,
  Vertex_4_Xcoordinate: 45.3375,
  Vertex_4_Ycoordinate: 4.5732,
  Vertex_4_Zcoordinate: 6.7056
}

  Version
    23.2;                    !- Version Identifier

API Reference

IDDManager

  • constructor(iddDir: string = './idds'): Creates a new IDDManager instance by pointing to the directory containing the preprocessed idds.
  • async getVersion(version: string, ts: boolean = false): Get a specific version of idd.
  • static fromIDD(iddString: string): Load an IDD from an Energy+.idd string. (TODO)

IDF

  • constructor(idd: IDD): Create a new IDF model instance from a given IDD object.
  • static async fromString(idfString: string, iddDir: string = './idds', globalIDDManager?: IDDManager, ts: boolean = false): Create a new IDF model instance from an .idf file string.
  • newObject(className: string, fields: IDFFields, ignoreDefaults: boolean = false): Adds a new IDF object for the given IDF class based on the given fields.
  • getObjects(className: string, re?: RegExp | undefined): Get IDF objects with the matching pattern.
  • getObject(className: string, name: string): IDFFields: Get an IDF object with the matching name.
  • toString(classIndentSize: number = 2, fieldIndentSize: number = 4, fieldSize: number = 22): Serialize the modified model back into a valid .idf file string.

License

Distributed under the MIT License.