2

I want to use sequalize but not with sqlite , postgres etc. . I want to put my data in JSON file is it possible ? Or is there any library like sequelize which i can use json file as a database ?

1 Answer 1

2

Yes! There are quite a few npm packages available which suits your requirement.

Here are few for your reference,

node-json-db - A simple "database" that use JSON file for Node.js project. - https://www.npmjs.com/package/node-json-db

disk-db - A Lightweight Disk based JSON Database with a MongoDB like API - https://www.npmjs.com/package/diskdb

low-db - JSON database for Node and the browser powered by lodash API - https://www.npmjs.com/package/lowdb

Hope this helps!

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks a lot but i think its not possible to use with sequelize ? I wan to use with sequelize to create data models
No. Unfortunately, Sequelize ORM is specifically designed to target databases which has transactional, relations support like PostgreSQL, MySQL, MariaDB, SQLite and MSSQL.
Thanks then how can i limit data types without sequelize. For example i want to have an element like user in json and username cant be null and datatype is string
Unfortunately, you can't achieve these features having a flat file (.json) as a data store.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.