node implementation of crf