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

@ngochipx/nhfinder-ant3

v1.0.1

Published

nhfinder for ckeditor

Downloads

4

Readme

NHFinder

NHFinder is a simple photo manager. Can integrate with CKEditor (has been customized).

Files

Source includes:

  1. build-inline: The custom ckeditor set can be integrated with NHFinder.
  2. nodejs: Back-end of NHFinder
  3. reactjs: Front-end of NHFinder

Install

yarn add @ngochipx/nhfinder

Using

  1. Create file config/nhfinder.js for the backend.
module.exports = {
ROOTDIR:  __ROOTDIR__, //The absolute path to the root directory.
UPLOAD_PATH:  __ROOTDIR__ + '/public/uploads/', //The absolute path to the upload folder.
PUBLIC_PATH:  '/uploads', //public path. For example, http: // localhost: 3000 / uploads / then enter: / uploads
DOMAIN:  'http://localhost:3000', //Domain used for image links.
ALLOW_EXTENSIONS: ['.jpg','.jpeg', '.png', '.bmp', '.gif','.txt'], //Extensions are allowed to uploads.
API_KEY:  "123456" //API Key uses security between client and server.
};
  1. In the routes file of the backend (use express). Add:

...
const  nhfinderConfig = require('config/nhfinder.js')
const  nhfinderRoutes = require('@ngochipx/nhfinder/nodejs/routes')(nhfinderConfig)

....
Route.use('/nhfinder', nhfinderRoutes) //You can change the link finder if you want.
...
  1. Create folder uploads like config in step 1. chmod 777. example:

mkdir ./public/uploads chmod 0777 ./public/uploads

  1. Import css in frontend's global file:
...
import '@ngochipx/nhfinder/reactjs/dist/main.css'
  1. In front-end. In the component need to integrate NHFinder:
....
import  NHFinder  from  '@ngochipx/nhfinder/reactjs'
...
initEditor = async () => {
	this.CKEditor = require("@ckeditor/ckeditor5-react");
	this.InlineEditor = require("@ngochipx/nhfinder/build-inline");
}
...
render(){
	return ... <this.CKEditor  editor={this.InlineEditor}
		data="<b>Click here to insert content ...</b>"
		onInit={editor  => { this.editor = editor}}
		config={{
			imageManagement: {
			component:  this.refNHFinder,
			options: {
				apiUrl:  "http://localhost:3333/api/v1/nhfinder",
				apiKey: "123456" //should match the backend ApiKey.
		}}
	/>
	...
	<NHFinder  ref={ref => this.refNHFinder = ref}  />
}
  1. Independent use (No need for CK Editor)
...
import  NHFinder  from  '@ngochipx/nhfinder/reactjs'
...

showNHFinder(){
	this.refNHFinder.show()
}
render(){
	return 
	...
	<NHFinder  
		ref={ref => this.refNHFinder = ref}  
		options ={{
			apiKey: "123456", //API KEY
		    directorySelected: "/", //Default selected folder
		    apiUrl: "http://localhost:3333/api/v1/nhfinder"
		    onChooseImages: (images) => { console.log(images); } //Callback function every time you select images.
		}}
	/>
}

ngochip