V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
wubaiqing
V2EX  ›  分享发现

[前端] 每日时报-2019.06.13

  •  
  •   wubaiqing · 2019-06-12 17:37:30 +08:00 · 956 次点击
    这是一个创建于 1787 天前的主题,其中的信息可能已经有所发展或是发生改变。

    [前端] 每日时报-2019.06.13

    https://github.com/wubaiqing/zaobao

    [新闻] VueConf 2019 尤雨溪演讲总结:https://mp.weixin.qq.com/s/6N6tuUEmS7eUOg82XQw8EA

    [类库] RxDB 是一个 JavaScript 客户端数据库,主要用于浏览器、NodeJS、Electron、Cordova、React-Native 以及其他任何 JavaScript 运行环境:https://github.com/pubkey/rxdb

    [类库] 有时我们需要在浏览器上生成文件并保存到本地,这个借助 FileSaver.js 就可以很方便地实现。FileSaver.js 是一款基于 HTML5 完成文件保存插件,它可以帮你直接从网页中导出多种格式文件:https://github.com/eligrey/FileSaver.js

    [类库] resolve-bin 是通过检查 node_modules 各个包中的 package.json bin 字段,来解析指定包的 bin 文件目录 :https://github.com/thlorenz/resolve-bin

    示例 - RxDB

    import RxDB from 'rxdb';
    const db = await RxDB.create({
        name: 'heroesdb',
        adapter: 'websql',
        password: 'myLongAndStupidPassword', // optional
        multiInstance: true                  // default: true
      });                                                       // create database
    
    await db.collection({name: 'heroes', schema: mySchema});    // create collection
    db.heroes.insert({ name: 'Bob' });                          // insert document
    

    示例 - FileSaver.js

    var FileSaver = require('file-saver');
    var blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"});
    FileSaver.saveAs(blob, "hello world.txt");
    

    示例 - resolve-bin

    var resolveBin = require('resolve-bin');
    
    // package.json: "bin": "bin/tap.js"
    resolveBin('tap', function (err, bin) {
      if (err) return console.error(err);
      console.log(bin);  
    });
    
    // => [..]/resolve-bin/node_modules/tap/bin/tap.js
    

    配图 - VueConf 2019 尤雨溪演讲总结

    今日图 - 工作的我 VS 下班的我

    查看更多: https://wubaiqing.github.io/zaobao/2019/06/12.html

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2417 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 312ms · UTC 00:12 · PVG 08:12 · LAX 17:12 · JFK 20:12
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.