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 🙏

© 2026 – Pkg Stats / Ryan Hefner

lectorjs

v0.9.15

Published

Read like you're on aderall

Readme

The Lector Experience

npm-size npm-size npm-size npm-size

🚀 Demo

Lector produces a reading enviroment, and summons a pointer that will help you read more efficient. It's sole purpose is to transfer a piece of text in the most efficient way possible to your melting brain.

To achieve this, Lector attempts to move the pointer precisely as your eyes would move on the text. This creates a dynamic between the pointer, your eyes and your mind. This dynamic can be expressed as "wiring in". Also known as super fucking focused on the text.

Contribute

First time:

git clone [email protected]:robo-monk/lector.git
cd lector
yarn install
  • Python 3 required (prefferably installed with brew)
  • virtualenv (pip install virtualenv)

Run this to compile the code when you make changes:

Depends on your package manager (my recommendation would be yarn)

source setup yarn
source setup npm

Install

Use npm or yarn:

yarn add pragmajs animejs compromise mousetrap

Using pragmajs:

import { Script } from 'pragmajs'

await Script.load('https://unpkg.com/lectorjs@latest/dist/lector.umd.js')
lectorjs.globalify() //loaded

Development

import { Script } from 'pragmajs'

console.time('📖 [lectorjs] load...')
await Script.load('https://unpkg.com/lectorjs@latest/dist/lector.umd.js', 'lector')
console.timeEnd('📖 [lectorjs] load...')

lectorjs.globalify() //loaded

// ...

Set up

Plug & play

The simplest way you can hookup Lector to your document is like this:

lec = Lector('#article')

// or if you want to await the initialization
;(async () => {
  await Lector('#article', options)
})()

This will trigger a pointer to the element's text, and generate a toolbar to control the pointer's settings.

Plug harder & play harder

You can declare Lector with many settings:

settings = {
  debug: false,
  onboarding: false,
  wfy: true,
  loop: false,
  autostart: false,
  autoscroll: false,

  fullStyles: true,
  defaultStyles: true,

  scaler: true,
  // set scaler: 'font-size' to scale the font instead of the parent element
  // use 'em' units for line-height, in order for it to scale proportionaly to the
  // scaled font

  pragmatizeOnCreate: true,
  experimental: true,

  settings: true,
  stream: fetchContent,
  // function with index as param that
  // returns the content for the page
  // can return a promise

  paginate: {
    from: 'stream',
    as: 'infiniteScroll',

    config: {
      first: 1,
      last: 69,
      headspace: 4,
      timeout: 1,
      onPageAdd,
      onCreate,
      onCreate,
      onPageActive,
      onPageInactive,
      onPageDestroy,
    },
  },
}

lec = Lector('#article', settings)

// default options
const defaultOptions = {
  onboarding: false,
  wfy: true, // false if every word is already wrapped in <w> tags on initializaiton
  settings: false, // display a settings bar controlling the pointer's color, width, speed and more...
  defaultsStyles: true, // inject basic styles
  fullStyles: false, // will decoreate the background of the page, buttons & fonts
  debug: false, // true if you want to see the lector logs #! When false, it hides all the console.log of the page - this will be refactored in new versions
  hintPointer: true, // when the pointer is out of screen, display arrows on top/bottom of the window that hint its position
  autoscroll: true, // sroll the view intelligently
  disableWhenNotInView: false, // offload when not in view
  global: false, // true if you want multiple lectors in the same page
  experimental: false, // if true experimental features are enabled. Unstable.

  // EXPERIMENTAL (set experimental: true to enable these options)
  scaler: false, // if true, scales the view, if set to 'font-size' will scale the font size using em
  stream: false, // this options only makes sense if you have paginated pages
  paginate: false,
  /* 
    paginate: {
      from: 'stream',
      as: 'infiniteScroll',
      config: { ... }
    }
  */
}