Comparing version 5.9.5 to 6.0.0-alpha-0
{ | ||
"name": "enmap", | ||
"version": "5.9.5", | ||
"version": "6.0.0-alpha-0", | ||
"description": "A simple database wrapper to make sqlite database interactions much easier for beginners, with additional array helper methods.", | ||
"main": "src/index.js", | ||
"main": "build/index.js", | ||
"scripts": { | ||
"test": "jest", | ||
"docs": "node ./docs/build.js" | ||
"test": "vitest", | ||
"coverage": "vitest run --coverage", | ||
"build": "ts" | ||
}, | ||
@@ -34,17 +35,19 @@ "repository": { | ||
"license": "Apache-2.0", | ||
"volta": { | ||
"node": "18.12.1" | ||
}, | ||
"dependencies": { | ||
"better-sqlite3": "^7.5.1", | ||
"better-sqlite3": "^8.0.1", | ||
"lodash": "^4.17.21", | ||
"on-change": "^2.2.3", | ||
"serialize-javascript": "^6.0.0" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^8.13.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"jest": "^26.6.3", | ||
"jsdoc-to-markdown": "^7.1.1", | ||
"limax": "^3.0.0" | ||
}, | ||
"types": "./typings/index.d.ts", | ||
"packageManager": "yarn@3.2.0" | ||
"@types/better-sqlite3": "^7.6.3", | ||
"@types/lodash": "^4.14.191", | ||
"@types/node": "^18.11.17", | ||
"@vitest/coverage-c8": "^0.25.8", | ||
"tslib": "^2.4.1", | ||
"typescript": "^4.9.4", | ||
"vitest": "^0.25.8" | ||
} | ||
} |
120
README.md
@@ -1,81 +0,63 @@ | ||
# Enmap - Enhanced Maps | ||
# ENMAP V6 PRE-RELEASE ALPHA | ||
<div align="center"> | ||
<p> | ||
<a href="https://discord.gg/N7ZKH3P"><img src="https://discordapp.com/api/guilds/298508738623438848/embed.png" alt="Discord server" /></a> | ||
<a href="https://www.npmjs.com/package/enmap"><img src="https://img.shields.io/npm/v/enmap.svg?maxAge=3600" alt="NPM version" /></a> | ||
<a href="https://www.npmjs.com/package/enmap"><img src="https://img.shields.io/npm/dt/enmap.svg?maxAge=3600" alt="NPM downloads" /></a> | ||
<a href="https://www.patreon.com/eviecodes"><img src="https://img.shields.io/badge/donate-patreon-F96854.svg" alt="Patreon" /></a> | ||
</p> | ||
</div> | ||
If you use this, don't. | ||
<div align="center"> | ||
<p><img src="https://evie.codes/enmap-logo.svg" alt="Enmap Logo" /> | ||
</div> | ||
## V5 => V6 | ||
Enhanced Maps are a data structure that can be used to store data in memory that can also be saved in a database behind the scenes. | ||
These operations are fast, safe, and painless. | ||
The biggest changes in V6 is that the cache is removed, any method that previously only worked on cached data will now work on *all* data. | ||
The data is synchronized to the database automatically, seamlessly, and asynchronously for maximum effectiveness. | ||
The storage system used is an `sqlite` database which is fast, performant, can be easily backed up, | ||
and supports multiple simultaneous connections. | ||
The cache may return as middleware or an option, but for now, it's been removed. | ||
## Documentation | ||
## Migration todo list | ||
* [Installation](https://enmap.evie.dev/install) | ||
* [Basic Setup](https://enmap.evie.dev/usage) | ||
* [API Reference](https://enmap.evie.dev/api) | ||
* [Examples](https://enmap.evie.dev/complete-examples) | ||
- [ ] autonum | ||
- [ ] set | ||
- [ ] update | ||
- [ ] get | ||
- [ ] close | ||
- [ ] push | ||
- [ ] math | ||
- [ ] inc | ||
- [ ] dec | ||
- [ ] ensure | ||
- [ ] has | ||
- [ ] delete | ||
- [ ] clear | ||
- [ ] destroy | ||
- [ ] remove | ||
- [ ] export | ||
- [ ] import | ||
- [ ] random | ||
- [ ] randomKey | ||
- [ ] sweep | ||
- [ ] filter | ||
- [ ] map | ||
- [ ] some | ||
- [ ] every | ||
- [ ] reduce | ||
- [ ] clone | ||
- [ ] concat | ||
- [ ] partition | ||
- [ ] equals | ||
- [ ] forEach | ||
- [ ] entries | ||
## Support | ||
## Renamed or alias removed | ||
Support is offered on my official [Evie.Codes Discord](https://discord.gg/N7ZKH3P). | ||
length, count => size | ||
indexes => keys() | ||
deleteAll => clear() | ||
array => values() | ||
keyArray => keys() | ||
## FAQs | ||
## Removed due to deprecation | ||
### Q: So what's Enmap? | ||
setProp, pushIn, getProp, deleteProp, removeFrom, hasProp, exists | ||
**A**: Enmaps are the Javascript Map() data structure with additional utility methods. This started | ||
as a pretty straight clone of the [Discord.js Collections](https://discord.js.org/#/docs/collection/main/class/Collection) | ||
but since its creation has grown far beyond those methods alone. | ||
## Deleted as no longer relevant | ||
### Q: What is "Persistent"? | ||
**A**: By using a database layer with `better-sqlite3`, any data added to the Enmap | ||
is stored not only in temporary memory but also backed up in a local database. This means that | ||
when you restart your project, your data is not lost and is loaded on startup. | ||
### Q: How big can the Enmap be? | ||
**A**: The size of the memory used is directly proportional to the size of all the keys loaded in memory. | ||
The more data you have, the more complex it is, the more memory it may use. You can use the | ||
[fetchAll](https://enmap.evie.dev/usage/fetchall) option to reduce memory usage. | ||
### Q: Who did you make this for? | ||
**A**: Enmap was made specifically for beginners in mind. It's for you, the budding javascript developer that wants to save data | ||
in a database but doesn't want to learn SQL - yet. It's also for people that want to rapidly prototype some app that depends on | ||
a database but doesn't want to have to deal with queries, even if it's not the most efficient way to do things. | ||
### Q: What can it be used for? | ||
**A**: Enmap is useful for storing very simple key/value data for easy retrieval, and also for more complex objects with many properties. | ||
Mainly, because of who I originally made this for, it's used in Discord.js Bots to save currencies, content blocks, server settings, and | ||
user information for bans, blacklists, timers, warning systems, etc. | ||
## Testimonials | ||
Some user comments! | ||
> I have legit tried several databases, from popular complicated ones to pretty basic ones. The only database I had absolutely no issue with was and still is enmap. | ||
> I know how to use a real db, but enmap is so sweet and easy to use | ||
> Thanks to Enmap, I am able to do tons of things that I never thought I would accomplish. | ||
From custom settings to even just saving the little things, it is amazing to use. | ||
> Enmap helped me, and it stills helps me, because it is very simple and useful. Thank you for creating Enmap. | ||
> Without your tutorials I didn't have an internship and some work.. :)) | ||
> Enmap was introduced to me fairly early, and has been essential to the growth and development of my bot. Without it, I'd have to use and learn complicated and unsafe systems. Enmap has helped me do exactly what I want with my bot. Thank you. | ||
fetch() | ||
fetchEverything() | ||
evict() | ||
changed() | ||
observe() |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
3
0
1
7323
7
5
167
1
64
+ Addedbetter-sqlite3@8.7.0(transitive)
- Removedon-change@^2.2.3
- Removedbetter-sqlite3@7.6.2(transitive)
- Removedon-change@2.2.3(transitive)
Updatedbetter-sqlite3@^8.0.1