New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

yux-storage

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yux-storage - npm Package Compare versions

Comparing version 1.2.1 to 2.0.0

3

package.json
{
"name": "yux-storage",
"version": "1.2.1",
"version": "2.0.0",
"description": "yux-storage 是一个基于 HTML5 IndexedDB 封装的 Web 本地数据离线存储库",
"main": "yux-storage.js",
"type": "module",
"scripts": {

@@ -7,0 +8,0 @@ "test": "echo \"Error: no test specified\" && exit 1"

@@ -25,12 +25,14 @@ # yux-storage

1. 直接在 [github](https://github.com/yued-fe/yux-storage) 获取 yux-storage.js (推荐)
1. 直接在 [github](https://github.com/yued-fe/yux-storage) 获取 yux-storage.js
```html
<script src="yux-storage.js"></script>
<script type="module" src="yux-storage.js"></script>
```
> 注意,`script`标签需要添加`type="module"`属性
2. 直接使用 unpkg [在线链接](https://unpkg.com/yux-storage)
```html
<script src="https://unpkg.com/yux-storage"></script>
<script type="module" src="https://unpkg.com/yux-storage"></script>
```

@@ -54,2 +56,10 @@

现在浏览器也可以通过这种方式引入
```html
<script type="module">
import yuxStorage from './yux-storage.js'
</script>
```
在页面中使用

@@ -131,2 +141,11 @@

## 多数据库
默认情况下会创建名为`yux-project`的数据库,如果有多数据库需求,可以通过`YuxDB`自行创建
```js
import { YuxDB } from 'yuxStorage'
const MyStorage = new YuxDB('test')
```
## API

@@ -312,4 +331,4 @@

// 自定义事件的数据在 ev.detail
const [type, detail] = ev.detail;
console.log(type, detail)
const [type, data] = ev.detail;
console.log(type, data)
// ‘setItem’, '{key, value}'

@@ -316,0 +335,0 @@ })

@@ -9,3 +9,3 @@ /**

class yuxDB {
export class YuxDB {

@@ -136,6 +136,3 @@ constructor(projectName) {

if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
module.exports = new yuxDB();
} else {
window.yuxStorage = new yuxDB();
}
window.yuxStorage = new YuxDB()
export default window.yuxStorage;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc