node.js 数据库

In this post, I’ll be discussing some tools I’ve found and used for different projects of mine. Why would we want to seed a database? There are typically a couple of reasons to seed a database. First, having data in your database is typically helpful for tests that need to hit the database. The second reason to seed a database is to show off a project, for example, a portfolio piece or an internal demonstration of something you developed for your company.

在这篇文章中,我将讨论一些我发现并用于我的不同项目的工具。 我们为什么要播种数据库? 建立数据库的种子通常有两个原因。 首先,在数据库中存储数据通常有助于需要访问数据库的测试。 播种数据库的第二个原因是炫耀一个项目,例如,项目组合或您为公司开发的项目的内部演示。

There are two categories of tools I’m listing. A data-oriented tool, and a few avatars tools.

我列出了两类工具。 一个面向数据的工具,以及一些化身工具。

Starting with the data-oriented tool, an NPM package, Chance. I love the variety of data that this tool can generate. Need to randomly generate an address? Chance can do it. Need random sentences? No problem. There are many different things that Chance can generate. I strongly suggest you check their documentation for the wide, and I do mean wide, variety of things it can generate.

从面向数据的工具NPM包Chance开始 。 我喜欢此工具可以生成的各种数据。 需要随机生成一个地址吗? 机会可以做到。 需要随机句子吗? 没问题。 机会可以产生许多不同的东西。 我强烈建议您检查他们的文档的范围,我的意思是它可以生成各种各样的东西。

What I find helpful, especially when using Chance in code tests, you can set a seed value for the pseudorandom generator that Chance uses. This way every time you run your program, as long as you invoke Chance’s functions in the same order, you will get repeatable results.

我发现有帮助,特别是在代码测试中使用Chance时,可以为Chance使用的伪随机生成器设置种子值。 这样,每次运行程序时,只要以相同的顺序调用Chance的函数,您将获得可重复的结果。

Gravatar logo
墓碑徽标

There is, however, one feature so far that I don’t like. That is Chance’s ability to generate avatar URLs. When invoked, it generates random Gravatar URLs that typically do not result in a meaningful avatar but rather the Gravatar logo as seen here on the left.

到目前为止,我不喜欢其中一项功能。 这就是Chance生成头像URL的能力。 调用时,它会生成随机的Gravatar URL,这些URL通常不会产生有意义的化身,而是会产生Gravatar徽标,如左图所示。

The next 3 tools are all static image generators. The intent is to be used as image placeholders typically for profiles. All 3 tools are simple RESTful APIs where a simple URL is all you need. The image on the left was generated by going to the following URL https://robohash.org/whatever.png?set=set4 in the browser and saving the image. Of course, we can do this programmatically too.

接下来的3个工具都是静态图像生成器。 该意图通常用作配置文件的图像占位符。 这3种工具都是简单的RESTful API,仅需一个简单的URL。 左侧的图像是通过在浏览器中转到以下URL https://robohash.org/whatever.png?set=set4并保存图像而生成的。 当然,我们也可以通过编程方式执行此操作。

What's nice is all of these APIs take in some value (in the example above, whatever) that will generate a unique image. The same image will be generated by the same phrase over and over again so it is repeatable. However, change that value and a completely different image will be generated.

什么是漂亮的是所有这些API的参加一些值(在上面的例子中, whatever ),将产生一个独特的形象。 相同的短语将一遍又一遍地生成相同的图像,因此它是可重复的。 但是,更改该值将生成完全不同的图像。

Starting off with my favorite, RobotHash, with which I used to generate the image on the left. This site is my favorite as I just happen to like robots. The site, if you read the short documentation (right on the home page) will also allow you to create monsters, humans, and cats (that cute kitty above is an example).

从我最喜欢的RobotHash开始,我用它来在左侧生成图像。 这个网站是我的最爱,因为我碰巧喜欢机器人。 如果您阅读了简短的文档(在主页上右侧),则该站点还可以使您创建怪物,人类和猫(上面的可爱小猫就是一个例子)。

Next up we have DiceBear Avatars. This tool has two notable features. First, it can generate ten categories of images (sprites) including this pixilated male image on the left, and yes they have a female option too. Notably one of the options, code, generates QR codes. The second feature, is they provide npm packages with lots of advanced options for each sprite.

接下来,我们有DiceBear头像 。 该工具具有两个显着功能。 首先,它可以生成十类图像(子画面),包括左侧的像素化男性图像,是的,它们也具有女性选项。 值得注意的是,其中一种代码选项可生成QR码。 第二个功能是,它们为npm包提供了每个sprite大量的高级选项。

Last but not least is Adorable Avatars. Of the three generators, this site has the least amount of options. Pretty much you get a square cartoonish face, such as this one on the left.

最后但并非最不重要的是可爱的化身 。 在这三个生成器中,此站点的选项最少。 您几乎会得到一张方形的卡通脸,例如左侧的这张脸。

The last tool I want to mention is Cartoon Avatars. This is an npm package that will randomly select URLs that resolve to cartoon avatars. What I like about these is that they are human placeholders and I can select male or female as an option. What should be noted is these images are not randomly generated, but rather randomly selected. There are 129 male avatars and 114 female avatars. That I believe should be enough for most projects.

我要提到的最后一个工具是“ 卡通头像” 。 这是一个npm软件包,它将随机选择解析为卡通头像的URL。 我喜欢这些是人类占位符,我可以选择男性还是女性作为选项。 应该注意的是这些图像不是随机生成的,而是随机选择的。 有129个男性头像和114个女性头像。 我相信对于大多数项目来说就足够了。

翻译自: https://levelup.gitconnected.com/tools-for-seeding-databases-in-node-js-72fb2f6c7320

node.js 数据库


http://www.taodudu.cc/news/show-5878737.html

相关文章:

  • 非常实用的三十个Python技巧,我都一一实践过了
  • 100% 远程办公也能培养企业文化、享受乐趣并组建办公空间 #Party Space
  • Android Bluetooth API及连接方式介绍
  • 来吧, BlueTooth Mesh
  • Bluetooth技术学习笔记 ——GAP
  • app读取低功耗蓝牙设备的数据并返回数据
  • 蓝牙 - 什么是Bluetooth Adapter或Dongle,以及Microsoft Bluetooth Enumerator
  • Windows之服务-详解篇
  • 美团Java面试题,java找不到工作要不要先去干别的
  • HP Elitebook 830 G5/Win10蓝屏 UcmUcsi.sys 错误解决
  • ELITEBOOK 惠普 限制功能
  • 惠普hp Elitebook 系列开启虚拟化
  • dell电脑EliteBook开启虚拟化
  • hp ELITEBOOK异常关机解决
  • hp计算机电源图标不见了,EliteBook 8xx G5 笔记本电脑 - 电池可能无法充电,系统托盘中没有显示电源图标...
  • 惠普elitebook笔记本u盘显示无访问权限的解决方法
  • HP Elitebook 8440p解决ubuntu10.10显卡,无线网卡不能用
  • 惠普EliteBook电脑系统中病毒怎么重新安装系统?
  • 惠普HP EliteBook G3官方升级至Windows 10的途径
  • Elitebook735安装ubuntu18
  • Elitebook735 没有插入键解决方法
  • HP EliteBook 开启虚拟化
  • HP Elitebook 830 G7电脑 Hackintosh 黑苹果efi引导文件
  • elitebook 735 G5安装linux系统卡在黑/紫屏解决方案
  • 学习和了解甲骨文造字方法 2021-07-19
  • html创建文字,Three中创建文字的几种方法
  • 在chrome中显示搜狗自造字
  • 如何查看csdn博主所有的文章
  • csdn上设置关注博主即可阅读全文【亲测有效】
  • 东方博宜OJ题库答案

node.js 数据库_Node.js中用于播种数据库的工具相关推荐

  1. node mysql 模块化_Node.js 模块系统

    Node.js模块系统 为了让Node.js的文件可以相互调用,Node.js提供了一个简单的模块系统. 模块是Node.js 应用程序的基本组成部分,文件和模块是一一对应的.换言之,一个 Node. ...

  2. egg.js java 生产数据_eggjs中,自动从数据库直接生成model.

    eggjs中,自动从数据库直接生成model. 使用sequelize-auto可以自动生成models 直接上命令就可以搞定了 # 安装必要的库 npm install -g sequelize-a ...

  3. cmd查看mysql数据库表_cmd中查看MySQL数据库表数据及结构

    0. 1 .cmd进入mysql安装的bin目录(C:\Program Files\XXXXXX\MySQL Server 5.6\bin) mysql -hlocalhost -uroot -p 回 ...

  4. mysql系统数据库服务器,mysql中的系统数据库服务器

    mysql中的系统数据库服务器 内容精选 换一换 用户正常的数据(不包括备份数据),以及云数据库RDS实例正常运行所需的数据(比如系统数据库.数据库回滚日志.重做日志.索引等).同时,包含如下云数据库 ...

  5. MongoDB数据库(8.Python中使用mongodb数据库以及pymongo模块用法)

    在Python中使用MongoDB数据库,首先要下载pymongo模块 直接在命令行   pip install pymongo   就可以了 Python中使用pymongo模块对MongoDB数据 ...

  6. hive中的数据库与mysql中的hive数据库的关系

    mysql中的hive数据库是自己手动创建的,然后执行下面语句: schematool -dbType mysql -initSchema 该语句的作用是在mysql的hive数据库下建立一大堆的表格 ...

  7. cgi mysql数据库_Perl CGI中操作Mysql数据库

    一. 安装DBI模块 步骤1: 从TOOLS栏目中下载DBI.zip,下载完后用winzip解开到一个temp目录,共有三个文件: Readme DBI.ppd DBI.tar.g 一. 安装DBI模 ...

  8. 复制oracle9i数据库,Oracle 10g 中Duplicate 复制数据库

    Oracle 10g 中Duplicate 复制数据库,本次实验通过duplicate命令,在本机环境中创建一个复制数据库.目标数据库为hongye.复制数 本次实验通过duplicate命令,在本机 ...

  9. oracle10g数据库复制,Oracle10g中Duplicate复制数据库

    Oracle 10g 中Duplicate 复制数据库,本次实验通过duplicate命令,在本机环境中创建一个复制数据库.目标数据库为hongye.复制数 本次实验通过duplicate命令,在本机 ...

最新文章

  1. Api 函数: GetCursorPos 与转换
  2. 你所需要的java异常的处理和设计及深入理解,看这篇就差不多了
  3. 浙江农林大学第二十一届程序设计竞赛校选拔赛(同步)
  4. sublime text3使用教程python_Sublime Text 编辑器配置 Python解释器简易教程
  5. 图论复习——dfs树,点双,边双,强连通分量
  6. (王道408考研操作系统)第三章内存管理-第二节3:页面置换算法1
  7. 《spring 2.0技术手册》的技术写作方式值得学习!
  8. w3cschool实战答案
  9. turbo编译码c语言,Turbo码的编译码基本原理和常用编译码算法分析及仿真程序
  10. UML建模与软件开发设计(三)——UML常用开发工具
  11. 什么是软件项目管理中的WBS?
  12. 调整VirtualBox虚拟磁盘VDI文件空间大小
  13. java rtmp推流_视频直播生成推流和播放地址的Java代码示例
  14. 第五次作业:项目分类
  15. processing作业:画有五角星绕圈的国旗(此例:塔吉克斯坦共和国国旗)
  16. 开水,送服JavaScript
  17. 微信小程序开发—消息推送
  18. 面向异构众核超级计算机的大规模稀疏计算性能优化研究
  19. Caffe学习(四)数据层及参数设置
  20. 第一个被赋予公明身份的机器人_机器人被赋予公民身份引发舆论关注

热门文章

  1. 内存缓存和硬盘缓存的特点
  2. Python语法解析器PLY——lex and yacc in Python - 娄振林专栏 - 博客频道 - CSDN.NET
  3. python中trunc函数_Oracle trunc()函数的用法及四舍五入 round函数
  4. 无需注册,不限次数!北大团队搞出ChatExcel
  5. 如何在百度、谷歌搜索到我的网站?
  6. android 清空回退栈,清空Fragment回退栈中某个Fragment
  7. 游龙传说服务器维护,游龙传说日常玩法有哪些 日常玩法说明
  8. linux下关闭redis服务
  9. float和double取值范围
  10. DC-DC升压转换器如何选择电感值?