lmaccherone / node-localstorage

A drop-in substitute for the browser native localStorage API that runs on node.js.
MIT License
450 stars 36 forks source link

Typescript support #82

Closed daniellalasa2 closed 1 year ago

daniellalasa2 commented 2 years ago

I think it doesn't support Typescript, since while I import it as a module I got:

Could not find a declaration file for module 'node-localstorage'. 'path-to-project/node_modules/node-localstorage/LocalStorage.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/node-localstorage` if it exists or add a new declaration (.d.ts) file containing `declare module 'node-localstorage';`
ianFar96 commented 1 year ago

Installing it with types solves the problem as the error suggests

lmaccherone commented 1 year ago

Here is where the types can be found: https://www.npmjs.com/package/@types/node-localstorage