Added NodeJS compatibility code