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

lore-server

v1.0.1

Published

A small server that runs inside of Adobe CEP extensions to listen for fetch() messages.

Downloads

11

Readme

lore-server

A small server that runs inside of Adobe CEP extensions to listen for fetch() messages from other extensions, plugins or local browsers.

Installation

$ npm install lore-server

Usage

// Via import:
import lore from 'lore-server'

// Via require:
const lore = require('lore-server').default;

Quickstart

Broadcasting a message from an Adobe extension, web app or plugin:

let msgObj = {
    appName: 'Figma',
    version: '1.0.3',
}

lore.message(3400, msgObj)

A Lore Message must contain a localhost port number to broadcast to, and a messsge that will be stringified.

Listening for messages within an Adobe extension:

function logMsg(msg) {
    console.log(msg)
}

lore.listener(3400, logMsg)

A Lore Listener must contain a localhost port number to listen to, and a function that will do something with the received message.

Note: This is creating a localhost server and must be run within a node app. It cannot be run within the browser.

Examples

// message to be sent to an Adobe extension
let msgObj = {
    actionName: 'popup',
    data: 'This is a message from an alternate dimension'
}

// port# and message data
lore.message(9320, msgObj)
// message listener inside of Adobe extension
function loreFilter (msg) {
    if (msg.actionName == 'popup') {
        alert(JSON.stringify(msg.data, false, 2))
    } else if (msg.actionName == 'newLayer') {
        /// code to create a new layer ///
    }
}

// port# and message data
lore.listner(9320, loreFilter)

The function loreFilter() is passed into the lore.listner() and parses the data that accompanies any messages received on port 9320. The data contained within this message is arbitrary and must be handled by the function passed into the listener.

About

This project is base on how heavily I personally rely on Adobe's Vulcan library for communication between Adobe extension panels. An attept to extend this concept outside of Adobe apps lead me to this article on the use of fetch() and the creation of localhost servers. Lore wraps up a lot of this to simplify server setup and fetch commands.

Thanks to Tom Scharstein for ongoing brain power and clarifying the process of creating a module.