added npm support and added some tests for that