npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

simditor-qn

v1.0.4

Published

express router for simditor-qn

Downloads

2

Readme

simditor-qn

simditor upload router with qiniu.com for expressjs

Artwork by i5ting.

Deps npm GitHub license npm

  • koa-simditor-qn for koa 2.x on koa branch
  • simditor-qn for express on master branch

Install

npm install --save simditor-qn

Usage

var express = require('express');
var app = express();

app.get('/', function (req, res) {
  res.send('Hello World!');
});

var simditor_qn_config = require('../simditor_qn')

require('simditor-qn')(app, simditor_qn_config);

var server = app.listen(3000, function () {
  var host = server.address().address;
  var port = server.address().port;

  console.log('Example app listening at http://%s:%s', host, port);
});

Configuration

module.exports = {
  path: '/simditor/upload',
  fileKey: 'file',
	multer:{ 
	 	dest: 'uploads/' 
	},
	qn:{
		accessKey: 'xxx',
		secretKey: 'yyy',
		bucket: 'mengxiaoban',
		origin: 'http://{bucket}.u.qiniudn.com',
		// timeout: 3600000, // default rpc timeout: one hour, optional
		// if your app outside of China, please set `uploadURL` to `http://up.qiniug.com/`
		// uploadURL: 'http://up.qiniu.com/',
	},
	url:function(result){
		return "http://img.mengxiaoban.cn/" + result.hash;
	}
}

说明

  • path : 默认是'/simditor/upload',是simditor里用到的路径
  • fileKey : 默认是'file',是simditor里用到的fileKey
  • multer是expressjs里上传的中间件
  • qn是fengmk2写的七牛的上传模块

Usage in Simditor

var editor = new Simditor({
  textarea: $('#editor'),
  //optional options
  upload: {
      fileObjName: 'file',
      url: '/simditor/upload',
      fileKey: 'file',
      params: {
          "token": window.qn_token
      }
  }
});

Test

npm start

打开Postman界面测试操作如下

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

版本历史

  • v1.0.0 初始化版本

欢迎fork和反馈

如有建议或意见,请在issue提问或邮件

License

this repo is released under the MIT License.