Socket
Socket
Sign inDemoInstall

ueditor

Package Overview
Dependencies
154
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.1 to 1.2.2

example/yarn.lock

26

lib/index.js

@@ -7,9 +7,13 @@ var Busboy = require('busboy');

var snowflake = require('node-snowflake').Snowflake;
var ueditor = function (static_url, handel) {
var qn = require('qn');
var ueditor = function (static_url, config = {}, handel) {
return function (req, res, next) {
var _respond = respond(static_url, handel);
var _respond = respond(static_url, config, handel);
_respond(req, res, next);
};
};
var respond = function (static_url, callback) {
var respond = function (static_url, config = {}, callback) {
if (typeof config === 'function') {
callback = config
}
return function (req, res, next) {

@@ -72,2 +76,18 @@ if (req.query.action === 'config') {

var dest = path.join(static_url, img_url, name);
var client = {};
if (config.qn) {
client = qn.create(config.qn);
client.upload(file, {
key: 'ueditor/images/' + name
}, function (err, results) {
if (err) throw err;
res.json({
'url': results.url,
'title': req.body.pictitle,
'original': filename,
'state': 'SUCCESS'
});
});
return false
}
var writeStream = fs.createWriteStream(tmpdir);

@@ -74,0 +94,0 @@ file.pipe(writeStream);

88

package.json
{
"name": "ueditor",
"decription": "nodejs for ueditor",
"author": {
"name": "Night_elf"
},
"version": "1.2.1",
"dependencies": {
"busboy": "^0.2.9",
"fs-extra": "^0.11.0",
"node-snowflake": "0.0.1"
},
"repository": {
"type": "git",
"url": "https://github.com/netpi/ueditor"
},
"main": "index.js",
"description": "",
"bugs": {
"url": "https://github.com/netpi/ueditor/issues"
},
"homepage": "https://github.com/netpi/ueditor",
"_id": "ueditor@1.0.0",
"scripts": {},
"_shasum": "28993ad1dbde8b1d83452400b1c77398f18e630e",
"_from": "ueditor@^1.0.0",
"gitHead": "2538eb8e109572939df8b8a02623f53aaf4e0de4",
"_npmVersion": "1.4.14",
"_npmUser": {
"name": "netpi",
"email": "hellonewworld@vip.qq.com"
},
"maintainers": [
{
"name": "netpi",
"email": "hellonewworld@vip.qq.com"
}
],
"dist": {
"shasum": "28993ad1dbde8b1d83452400b1c77398f18e630e",
"tarball": "http://registry.npmjs.org/ueditor/-/ueditor-1.0.0.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/ueditor/-/ueditor-1.0.0.tgz"
}
"name": "ueditor",
"decription": "nodejs for ueditor",
"author": {
"name": "Night_elf"
},
"version": "1.2.2",
"dependencies": {
"busboy": "^0.2.9",
"fs-extra": "^0.11.0",
"node-snowflake": "0.0.1",
"qn": "^1.3.0"
},
"repository": {
"type": "git",
"url": "https://github.com/netpi/ueditor"
},
"main": "index.js",
"description": "",
"bugs": {
"url": "https://github.com/netpi/ueditor/issues"
},
"homepage": "https://github.com/netpi/ueditor",
"_id": "ueditor@1.0.0",
"scripts": {},
"_shasum": "28993ad1dbde8b1d83452400b1c77398f18e630e",
"_from": "ueditor@^1.0.0",
"gitHead": "2538eb8e109572939df8b8a02623f53aaf4e0de4",
"_npmVersion": "1.4.14",
"_npmUser": {
"name": "netpi",
"email": "hellonewworld@vip.qq.com"
},
"maintainers": [{
"name": "netpi",
"email": "hellonewworld@vip.qq.com"
}],
"dist": {
"shasum": "28993ad1dbde8b1d83452400b1c77398f18e630e",
"tarball": "http://registry.npmjs.org/ueditor/-/ueditor-1.0.0.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/ueditor/-/ueditor-1.0.0.tgz"
}

@@ -1,2 +0,2 @@

#Node.js : ueditor
# Node.js : ueditor

@@ -18,3 +18,3 @@

##Usage
## Usage

@@ -64,3 +64,3 @@ ```javascript

```
##Example
### 七牛上传
```javascript

@@ -75,3 +75,11 @@

app.use("/ueditor/ue", ueditor(path.join(__dirname, 'public'), function(req, res, next) {
// 支持七牛上传,如有需要请配置好qn参数,如果没有qn参数则存储在本地
app.use("/ueditor/ue", ueditor(path.join(__dirname, 'public'), {
qn: {
accessKey: 'your access key',
secretKey: 'your secret key',
bucket: 'your bucket name',
origin: 'http://{bucket}.u.qiniudn.com'
}
}, function(req, res, next) {
// ueditor 客户发起上传图片请求

@@ -100,3 +108,3 @@ var imgDir = '/img/ueditor/'

```
###多类型文件上传 (附件 视频 图片)
### 多类型文件上传 (附件 视频 图片)
```javascript

@@ -103,0 +111,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc