require

How do I get code completion for Node.js in Eclipse?

青春壹個敷衍的年華 提交于 2019-12-04 03:22:41
When developing a Node.js application in Eclipse , you usually import your own modules with functionality tied to exports (append functions) or module.exports (allows popular object literal notation). But how do you set this up for code completion in files where you import your module? Module As you can see in the outliner , Eclipse is "aware" of the function: Yet importing the module as tools doesn't make it's functions available: I also tried the oldskool //@import tools.js but it doesn't seem to work like this. How do I get code completion for my own functions in my project? Redsandro @ Jey

stf二次开发

北城以北 提交于 2019-12-04 03:00:46
前几天装了一下stf环境 , mac环境搭建stf 环境搭建还是比较简单的。这个平台登陆的时候是没有限制的,只要输入个名称和邮箱就可以登陆。打算修改一下,改成公司内部账号登陆,下面来撸一撸代码。 这张图片是在网上找的,根据这个区分出来了前端和后端代码。 stf前端使用的是angularjs语言开发的(测试小白,以前没有听过?),后端是nodejs(对于使用Java的我来说,这两个语言有点懵)没办法现学现卖,先去看看基本语法,然后在结合stf源码慢慢啃吧。 打开stf地址是http://192.168.110.18:7100/auth/mock/ 在res路径下面找到了前端代码,修改.pug文件可以改变前端页面渲染。 先打开signin.pug把邮箱和name换一下,把name输入框换成password输入框。 .login2(ng-controller='SignInCtrl') .login-wrapper a(href='./') img(width='200', height='85', src='/static/logo/exports/STF-512.png', title='STF') form(name='signin', novalidate, ng-submit='submit()') .alert.alert-danger(ng-show='error')

webpack笔记

帅比萌擦擦* 提交于 2019-12-04 02:17:27
webpack的卸载 webpack4.x开始官方文档是说要单独安装webpack-cli所以如果是用4.+就需要卸载cli //删除全局webpack-cli 卸载uninstall可以简写成un,全局-g的完整写法是--global npm uninstall -g webpack-cli //删除本地(局部)webpack-cli npm uninstall webpack-cli //删除全局webpack npm uninstall -g webpack //删除本地webpack npm un webpack webpack的安装与使用 在空文件夹pratice下执行: //全局安装,默认最新版本,可以使用@指定版本 npm install webpack -g //可以使用cnpm淘宝镜像,这样速度更快 npm install -g cnpm --registry=https://registry.npm.taobao.org //用cnpm来安装。速度较快 cnpm install webpack -g //在3版本及之前安装webpack的时候就一同把webpack-cli也下载了,但是webpack4开始需要手动安装webpack-cli //安装webpack-cli cnpm install webpack-cli -g //查看版本号 webpack -v

Babel transpiles 'import' to 'require', but 'require isn't useable in ecma5

…衆ロ難τιáo~ 提交于 2019-12-04 02:02:13
It was my understanding that use Babel allows you to use ecma6 javascript in an ecma5 environment by transpiling. When I use 'import' however, the 'import' is transpilied to 'require'. 'require' isn't ecma5 and requires the library 'require.js'. Therefore you can't use 'import/ export' without additional dependencies, is this correct? Yes, Babel is just intended for translating new language features to be compatible with modern javascript engines. Babel doesn't compile to require.js module import syntax. Rather it uses the CommonJS module syntax as used by Node.js. So you could run the code

plv8 require 模块试用

守給你的承諾、 提交于 2019-12-04 01:50:44
plv8 是postgres 的一个比较强大的插件,社区有人基于babel,browserify 实现了一个方便的require 模块加载 实际上官方也有介绍过了类似的基于数据库存储js,然后通过eval 动态加载代码,以下是一个简单的试用 环境准备 docker-compose 文件 version: '3.6' services: postgres: image: dalongrong/plv8:2.3.12 ports: - "5432:5432" environment: - "POSTGRES_PASSWORD=dalong" graphql-engine: image: hasura/graphql-engine:v1.0.0-beta.9 ports: - "8080:8080" depends_on: - "postgres" environment: HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:dalong@postgres:5432/postgres HASURA_GRAPHQL_ENABLE_CONSOLE: "true" # set to "false" to disable console HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log,

nodejs 基础篇整合

99封情书 提交于 2019-12-03 23:44:18
nodeJs 基础篇整合 最近有朋友也想学习nodeJs相关方面的知识,如果你是后端想接近前端,node作为一门跑在服务端的JS语言从这里入门再好不过了。如果你正好喜欢前端,想走的更高,走的更远。nodeJs同样也是不二之选。node的地位虽然在实战项目中运用的不是很多,但也不能否认它在处理高并发,服务端渲染,前端自动化方面的优势。总而言之。如果你是个自学能力很强的人。请来到这里学习。让我们一起去打开node的世界,游走于前端与服务端之间。你如果能掌握如下知识那么你的node基础功底将会十分强大。 简介: Node.js 就是运行在服务端的 JavaScript。 Node.js 是一个基于Chrome JavaScript 运行时建立的一个平台。 Node.js是一个事件驱动I/O服务端JavaScript环境,基于Google的V8引擎,V8引擎执行Javascript的速度非常快,性能非常好。 底层选择用c++和v8来实现的 优势:1. RESTful API 这是NodeJS最理想的应用场景,可以处理数万条连接,本身没有太多的逻辑,只需要请求API,组织数据进行返回即可。它本质上只是从某个数据库中查找一些值并将它们组成一个响应。由于响应是少量文本,入站请求也是少量的文本,因此流量不高,一台机器甚至也可以处理最繁忙的公司的API需求。 统一Web应用的UI层 目前MVC的架构

用node爬取网页上的内容

半城伤御伤魂 提交于 2019-12-03 23:41:54
如何用node简单的爬取网页上的内容: 1.安装express以及生成器 express官网: http://www.expressjs.com.cn/ npm install express --save npm install express-generator -g 2.用生成器创建新Express应用,进入项目并安装依赖包 express myapp cd myapp npm install 3.安装superagent superagent官网: http://visionmedia.github.io/superagent/ npm install superagent 4.安装cheerio cheerio官网: https://cheerio.js.org/ npm install cheerio 5.在routes文件夹下新建路由文件news.js var express = require("express"); const cheerio = require('cheerio'); const superagent = require('superagent'); var router = express.Router(); router.get('/', function (req, res, next) { // 抓取内容 superagent.get(

Require ruby file without .rb extension?

心不动则不痛 提交于 2019-12-03 23:41:38
问题 I have a ruby file that does not have a .rb extension, and is instead identified as ruby code with a shebang at the beginning of the file: #!/usr/bin/env ruby . I want to require the code in this file in another ruby file, but it seems to be having a problem because require automatically appends the .rb extension to the files it looks for. Is there any way to suppress this behavior and make require only look for the file as the name is given? 回答1: Use load instead: load 'file-name' 回答2: We

tp5 安装migration 报错 Installation failed, reverting ./composer.json to its original content.

ぐ巨炮叔叔 提交于 2019-12-03 22:57:54
默认migration是2.*版本,因为TP5版本并不一致,所以报错。 根据TP5的版本不同,安装的migration版本也不同 5.0版本要安装 1.* migration ,2.* migration版本只支持 TP 5.1 5.0版本在窗口执行 composer require topthink/think-migration=1.* 5.1 版本在窗口执行 composer require topthink/think-migration 来源: https://www.cnblogs.com/ikai/p/11810388.html

vue中引入echarts的两种方式

↘锁芯ラ 提交于 2019-12-03 21:45:44
全局引入 1. main.js中配置 import echarts from 'echarts' //引入echarts Vue.prototype.$echarts = echarts //引入组件 2. echarts.vue中引用 <div id="myChart" :style="{width: ‘300px‘, height: ‘300px‘}"></div> <script> export default { name: ‘eCharts‘, data () { return { msg: ‘Welcome to Your Vue.js App‘ } }, mounted(){ this.drawLine(); }, methods: { drawLine(){ // 基于准备好的dom,初始化echarts实例 var myChart = this.$echarts.init(document.getElementById(‘myChart‘)) // 绘制图表 myChart.setOption({ title: { text: ‘在Vue中使用echarts‘ }, tooltip: {}, xAxis: { data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"] }, yAxis: {}, series: [{ name: ‘销量‘,