# 2020.8.5 今天是每日时报陪伴您的第 387 天

[文章] 如何判断一条路径存在交叉:https://juejin.im/post/6855840679805845517 (opens new window)

[工具] starboard-notebook,可以支持 HTML、CSS、JS 的在线 MD notebook;有点在线 VuePress 的味道:https://github.com/gzuidhof/starboard-notebook (opens new window)

[类库] set-value 可以用点(.)符号,设置对象的值:https://github.com/jonschlinkert/set-value (opens new window)

[类库] node-modules/address 可以获取到当前电脑的 IP、MAC、DNS servers:https://github.com/node-modules/address (opens new window)

[类库] 一个基于 IndexedDB 实现的超级简单的基于 Promise 的 key/val 存储:https://github.com/jakearchibald/idb-keyval (opens new window)

# 配图 - starboard-notebook

# 示例 - validate-npm-package-name

var validate = require("validate-npm-package-name");

validate("some-package");
validate("example.com");
validate("under_score");
validate("123numeric");
validate("excited!");
validate("@npm/thingy");
validate("@jane/foo.js");

# 示例 - node-modules/address

var address = require("address");

// default interface 'eth' on linux, 'en' on osx.
address.ip(); // '192.168.0.2'
address.ipv6(); // 'fe80::7aca:39ff:feb0:e67d'
address.mac(function(err, addr) {
  console.log(addr); // '78:ca:39:b0:e6:7d'
});

// local loopback
address.ip("lo"); // '127.0.0.1'

// vboxnet MAC
address.mac("vboxnet", function(err, addr) {
  console.log(addr); // '0a:00:27:00:00:00'
});

# 示例 - idb-keyval

import { set } from "idb-keyval";

set("hello", "world")
  .then(() => console.log("It worked!"))
  .catch(err => console.log("It failed!", err));
Last Updated: 8/5/2020, 6:39:11 PM