npm api instead of exec