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 🙏

© 2025 – Pkg Stats / Ryan Hefner

jsrope

v1.0.1-alpha

Published

test pointers by network tracker

Readme

Editor.md

RopeJS is a purely functional programming web framework that abstracts all elements into a single function, and all data binding is also implemented through passing parameters. So even if you don't use JSX like syntax, you can write a semantical DOM structure using javascript!

install or inject

npm i jsrope

or

<script src="https://xxxxxx.ropejs.js"></script>

Why use RopeJs?

Rope was born to perform simple page building without any web clis( npm vue-cli create-app... ), so once your HTML introduces RopeJs , your js can be as follows:

<html>
  <body>
    <style>
      span {
        display: block;
      }
    </style>
    <script src="./lib/rope.js"></script>
    <script type="text/javascript">
      const { Rope } = window
      const { text, div, hooks, input, list } = Rope;
      
      const rope = new Rope(1);
      const app = hooks((props, state, setState) => {
        return div(
          text(props, 'text'),
          text(state, 'text')
        );
      }, { text: 'Hello world!From state!' });

      document.body.appendChild(app({
        text: 'Hello world!From props!'
      }).element);

    </script>
  </body>
</html>

The operation result is shown in the figure!

Element

VElement

All components inherit from the VElementClass. Let's take the 'div component' as an example to demonstrate the basic functions of a component:

const { div } = Rope;

const child1 = div()
  .className('a-div-1')
  .style({
    width: '50px',
    height: '50px',
    backgroundColor: 'red'
  })
  .onClick(() => { alert('a-div-1') })

const child2 = div()
  .className('a-div-2')
  
// Direct nesting is allowed here
div(child1, child2)

Text

In Rope, a text component is defined as text, which is essentially a span. Let's take a look at the demonstration below:

const { text } = Rope;

test('I'm a span as text!)
  .className('a-text')
  .style({
    contSize: '12px',
    color: 'gray'
  })
  .onClick(() => { alert('a-text') })

Hook Component

Usually, we need to reuse a set of elements, that is, the concept of components. At this point, we need to use hooks

Use

const { hooks, div, text } = Rope;

const myComponent = hooks((props, state, setState) => {
  return div(
    text(props, 'text'),
    text(state, 'text')
  )
}, { text: "I'm state.text!" });

const props = {
    text: "I'm props.text!"
};
document.body.appendChild(myComponent(props))

Bind state && set state

Because RopeJS is filled with functions everywhere, the binding rules for data can be represented by the number of parameters to the function, using text as an example:

Static

The value of text here will never change!

const app = hooks((props) => {
  return text(props.text)
});

app({ text: "I'm props.text!" });
Dynamics

Here, the value of text always points to object.text!

const app = hooks((props) => {
  return text(props, 'text')
})

app({ text: "I'm props.text!" });
Dynamics with filter

The third parameter here can be a function, and the final value is based on the return value of the function!

const app = hooks((props) => {
  return text(props, 'text', (text) => {
    return `Text is: ${text}!`
  })
})

app({ text: "I'm props.text!" });