javascript implementation of cnets