Updated as function returning js obj from command