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

npjs

v0.1.5

Published

The simple SPA library

Downloads

5,371

Readme

NPjs - Simple Single App Page

Online Demo

install

npm install npjs

script

https://simple-singal-app-page.herokuapp.com/np.min.js
https://simple-singal-app-page.herokuapp.com/np.js

usage

<html>
  <body>
    <div id="app"></div>
    <script src="https://simple-singal-app-page.herokuapp.com/np.min.js"></script>
    <script>
    	NP.init('app');
    </script>
  </body>
</html>

router

//client
NP.routes = [
  {
    path : '/your-path',
    template : {
      title : 'Your title',
      html : `Your HTML code`
    }
  }
];
//server
app.get('/your-path',function(request,response){
	response.render('client_file');
});

render data

using {{your_data}} in HTML code -> NP.data.your_data

if

<h1 np-if="seen">Seen</h1>
<script>
  NP.data.if.seen = true;  //false to hide element
</script>

for loop

<ol>
 <li np-for="human">
  <p style="color:red">
    <np tag="text-for" data="name"></np>
  </p>
  <p style="color:yellow">
    - <np tag="text-for" data="sex"></np>
  </p>
 </li>
</ol>
<script>
  NP.data.for = {
     human : [
      { name : 'bob' , sex : 'male' },
      { name : 'alice' , sex : 'female' }
    ]
  };
</script>

init css

<np tag="style">
    <!--your style code -->
</np>

init JS

<np tag="script">
    <!--your JS code -->
</np>

Proxy data

NP.dataProxy.???  //change dataProxy -> change data and data rendered in HTML

Components

you may refer offline demo using webpack

clone

git clone https://github.com/zenlykoi/NPjs-Simple-Single-App-Page.git

Install NPM

npm install

start server

node index
-> demo in http://localhost:3000/component-index

build

webpack

watch

webpack --watch

advice

You may use coffeeScript syntax in VScode to code component(multiline string) !