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

wysiwyg-editor-node-sdk-qn

v0.1.2

Published

Node.js SDK for Froala Editor with Qiniu Cloud

Downloads

8

Readme

Froala WYSIWYG Editor Node.JS SDK (with Qiniu Cloud)

npm npm npm

Easing the Froala WYSIWYG HTML Editor server side integration in Node.JS projects.

Installation

  1. Clone this repo or download the zip.

  2. Run npm install.

  3. (Optional) Run bower install to install the editor JS.

  4. Load lib directory in your project and import it: var FroalaEditor = require('path/to/lib/froalaEditor.js');

  5. To run examples:

  • npm start to start a nodejs server form examples directory at http://localhost:3000/

Import lib

var FroalaEditor = require('path/to/lib/froalaEditor.js');

Documentation

基础用法:

使用七牛云:

app.post('/upload_image_validation', function (req, res) {
  var options = {
    accessKey: 'Your AccessKey', // AK
    secretKey: 'Your Secretkey', // SK
    bucket: 'Bucket Name', // 存储空间名称
    zone: 'Zone_z0', // 机房位置 华东Zone_z0 华北Zone_z1 华南Zone_z2 北美Zone_na0
    domain: 'Your domain', // 测试域名或cdn加速域名(末尾不加/)
    fieldname: 'myImage',
    validation: function(filePath, mimetype, callback) {
    
      gm(filePath).size(function(err, value){

        if (err) {
          return callback(err);
        }

        if (!value) {
          return callback('Error occurred.');
        }

        if (value.width != value.height) {
          return callback(null, false);
        }
        return callback(null, true);
      });
    }
  }

  FroalaEditor.Image.uploadQn(req, '/uploads/', options, function(err, data) {

    if (err) {
      return res.send(JSON.stringify(err));
    }
    res.send(data);
  });
});
  • 使用七牛云后,文件将不再保存至本地(设置文件路径是为了暂存文件,用于实现用户自定义验证功能,验证结束后文件会删除)
  • 关于七牛云的更多信息,请访问官方文档

Help

License

The Froala WYSIWYG Editor Node.JS SDK is licensed under MIT license. However, in order to use Froala WYSIWYG HTML Editor plugin you should purchase a license for it.

Froala Editor has 3 different licenses for commercial use. For details please see License Agreement.