1 Star 2 Fork 1

Lauset / vuetom-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Vuetom.js

  • 💪 Immutable
  • 🔥 Chainable

Getting Started

Installation

npm install vuetom --save

Using Vuetom.js & Plugins

Node.js

Available Plugins: request, date

const { createVuetom, isVuetom } = require('vuetom')
const vt = createVuetom()

use date plugin

const date = require('vuetom/plugin/date')
vt.use(date)
console.log(vt.date(new Date(), 'YYYY-MM-DD HH:mm:ss')) // 2022-xx-xx xx:xx:xx
console.log(vt.getDate()) // get date object

use http request plugin

Function has:

  • http
  • httpGet
  • httpPost
  • httpJsonp
  • httpFetch
const request = require('vuetom/plugin/request')
vt.use(request)
vt.http('https://api.github.com/users/yyx990803', {
  method: 'get'
}, (err, resp, body) => {
  console.log('err', err)
  console.log('body', body)
})

ES6 syntax

Available Plugins: date

import { createVuetom } from 'vuetom'
import date from 'vuetom/plugin/date'
// The usage is the same as nodejs
// ...

Browser

Available Plugins: date

<script src="../vuetom/dist/vuetom.js"></script>
<script src="../vuetom/dist/plugin/date.js"></script>
<script src="../vuetom/dist/plugin/storage.js"></script>
<script>
  var vt = vuetom.createVuetom()
  var vt_date = window.vt_plugin_date
  var vt_storage = window.vt_plugin_storage

  vt.use(vt_date)
  console.log(vt.date(new Date, 'YY MM DD'))

  vt.use(vt_storage)
  vt.storage.set('key1', 'val1')
  console.log(vt.storage.get('key1')) // val1
</script>

Plugins

[Common]

  • date: Simple date time conversion

[Node]

  • request: HTTP request based on nodejs

[Browser]

  • storage: LocalStorage Utils

Development

pnpm install

packages/vuetom

cd packages/vuetom

# build dist
pnpm b

# build modules
pnpm b:esm

# build browser node
pnpm b:umd

packages/test

cd packages/test

# node test
pnpm test-n 

# es test
pnpm test-es

# web test
# preview.html

License

Vuetom.js is licensed under a MIT License.

空文件

简介

集成众多 js 类库使用,提供了插件化功能可单独应用功能模块,项目采用 pnpm monorepo 工程化可持续集成个人的 js 工具类 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
TypeScript
1
https://gitee.com/lauset/vuetom-js.git
git@gitee.com:lauset/vuetom-js.git
lauset
vuetom-js
vuetom-js
main

搜索帮助