ABSTRACT The concept of a global Internet of Things (IoT), as proposed by Bart, revolutionizes connectivity by assigning unique digital identities to everyday objects, thereby enabling the development of smarter devices. However, the advancement and expansion of the IoT face significant obstacles and constraints, including energy efficiency and memory usage, which require further investigation. To address these challenges, this study presents a novel framework named IoT.js. This framework aims to facilitate the interconnection of lightweight devices within the web-based IoT ecosystem. These devices, ranging from microcontrollers to those with limited memory capacities, stand to benefit from IoT.js’s utilization of JavaScript for IoT application development. By promoting collaboration among lightweight devices with small memory sizes, IoT.js offers a promising solution to the resource constraints encountered in IoT deployments. This study contributes to the advancement of the IoT landscape by introducing a new approach that not only enables the efficient use of limited resources but also facilitates the seamless interconnection of lightweight devices within the IoT network. Additionally, the study conducts performance analysis to measure the efficacy of the proposed framework. Through rigorous evaluation of key metrics, such as energy efficiency and memory usage, the research findings validate the effectiveness of IoT.js in addressing the challenges associated with IoT deployment. Overall, the proposed IoT.js based approach represents a significant step forward in enhancing interconnectivity within the IoT ecosystem, thereby unlocking new possibilities for the development of innovative IoT applications and services.