extracting code to npm library and adding functionality to save a list item