useful tools collection

1.正则表达式

可视化正则表达式解释  https://regexper.com/

151745_GaKp_2267438.png

2.shell

可视化shell   https://explainshell.com/

152236_22SZ_2267438.png

 

3. 函数式编程

ramda是一个js实现的函数式编程库。我已经在我的项目中使用了它,当然lamda也可以充当这样的功能。这里提供了一个在线的函数式编程页面。

可以在左侧写代码。右侧看输出。 跟codepen比较相似,但是一方面不用写依赖(引入ramdajs),一方面我们写函数式代码其实用不到界面,不是吗?

这对于你练习函数式编程很有帮助。

http://ramdajs.com/repl/?v=0.23.0

144453_Kl6y_2267438.png

4.文档工具

一个是根据markdown生成网站的docsify。不限语言,你可以在项目中写README.md然后把它作为数据源给docsify,然后你的markdown就可以展示在网页上了。

https://docsify.js.org/#/

160937_S8AF_2267438.png

一个是根据段落注释(一些特定的tag)生成文档以及索引(用于搜索)

https://yuilibrary.com/

160823_mhOF_2267438.png

 

 

4. 测试工具

http://karma-runner.github.io/1.0/index.html

 

karma是一个完善的测试体系。可以支持多种浏览器,断言库,测试框架。最重要的是它支持热替换.

161923_mr1M_2267438.png

这让你在写代码时可以大胆的写了,前提是覆盖率足够(如果覆盖率低,会让你自己产生代码没问题的假象)

一个典型的karma配置文件:

// Karma configuration Generated on Wed Dec 28 2016 12:50:33 GMT+0800 (中国标准时间)
var webpack = require( 'webpack' );
var path = require( 'path' );
var nodemodulesPath = path.resolve( __dirname, 'node_modules' );

module.exports = function ( config ) {
	config.set({

		// base path that will be used to resolve all patterns (eg. files, exclude)
		basePath: '',

		// frameworks to use available frameworks:
		// https://npmjs.org/browse/keyword/karma-adapter
		frameworks: ['mocha'],

		// list of files / patterns to load in the browser
		files: ['test/**/*.spec.js'],

		// list of files to exclude
		exclude: [],

		preprocessors: {
			'test/**/*.spec.js': [ 'webpack' ]

		},

		reporters: [
			'progress', 'coverage'
		],

		// add
		coverageReporter: {
			type: 'html',
			dir: 'coverage/'

		},

		// web server port
		port: 9876,

		// enable / disable colors in the output (reporters and logs)
		colors: true,

		// level of logging possible values: config.LOG_DISABLE || config.LOG_ERROR ||
		// config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
		logLevel: config.LOG_INFO,

		// enable / disable watching file and executing tests whenever any file changes
		autoWatch: true,

		// start these browsers available browser launchers:
		// https://npmjs.org/browse/keyword/karma-launcher
		browsers: ['Chrome'],

		// Continuous Integration mode if true, Karma captures browsers, runs the tests
		// and exits
		singleRun: false,

		// Concurrency level how many browser should be started simultaneous
		concurrency: Infinity,
		// webpack
		webpack: {
			module: {
				loaders: [
					{
						test: /\.js$/,
						loader: 'babel',
						exclude: [nodemodulesPath],
						query: {
							presets: ['es2015'],
							plugins: [ 'istanbul', 'transform-object-rest-spread' ]

						}

					}, {
						test: /\.json$/,
						loader: 'json'

					}
				]

			}

		}

	})

}

同时packge中定义依赖

{
  "name": "xxx",
  "version": "1.0.0",
  "private": true,
  "entry": {},
  "dependencies": {
  },
  "devDependencies": {
    "babel-eslint": "^6.0.2",
    "babel-loader": "^6.2.8",
    "babel-plugin-istanbul": "^3.0.0",
    "babel-plugin-transform-object-rest-spread": "^6.23.0",
    "babel-plugin-transform-runtime": "^6.8.0",
    "babel-preset-es2015": "^6.24.1",
    "babel-runtime": "^6.6.1",
    "chai": "^4.0.0-canary.1",
    "karma": "^1.3.0",
    "karma-chrome-launcher": "^2.0.0",
    "karma-coverage": "^1.1.1",
    "karma-mocha": "^1.3.0",
    "karma-webpack": "^1.8.1",
    "mocha": "^3.2.0",
    "mocha-loader": "^1.0.0",
    "webpack": "^1.9.13",
    "webpack-dev-server": "^1.16.2"
  },
  "scripts": {
    "test": "karma start"
  },
}

6. 部署

一个超轻量的工具。可以配置一个json文件,一键部署代码,支持正则,配置足够灵活。而且还有进度条,哈哈~

https://github.com/azl397985856/deploy

一个典型的配置如下:
 

{
    "uatStepOne": {
        "host": "xx.xx.xx.xx",
        "username": "root",
        "port": "22",
        "password": "xxxxxxxxxxxxxx",
        "remoteDir": "/Data/deploy/xxxxx",
        "path": "\\.(js|json|css)$",
        "base": "./assets/"
    },
    "uatStepTwo": {
        "host": "xx.xx.xx.xx",
        "username": "root",
        "port": "22",
        "password": "xxxxxxxxxxxxxx",
        "remoteDir": "/Data/deploy/xxxxxx",
        "path": "index.*\\.html",
        "base": "./new_assets/html/"
    },
}

7. 画图工具

之前一直使用processon,操作非常简单,现在尝试使用draw,操作上同样简单,同时支持github仓库绑定,对于码农老说非常好用。

https://www.draw.io/

8.  响应式开发工具

https://browsersync.io/              browserSync 工具非常棒且永久免费。之前我写介绍过这个工具。简单来说就是Time-saving synchronised browser testing.

9. 在线代码

CodePen  JSFiddle都很好用

10.  网络工具

charles 或者 fiddler

11. 代码统计工具

cloc

http://cloc.sourceforge.net/

 

12. 性能测试 & 性能优化

WebPagetest.org 是一个免费工具,可以使用来自世界各地的真实设备对你的网站进行测试

转载于:https://my.oschina.net/wanjubang/blog/906625

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值