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

scpo-proce

v2.10304.0

Published

Make your async programming easier

Downloads

22

Readme

Scpos Process

简体中文 | English

The full name of scpoProce is Scpos Process, which is a super high-level Promise-like class for saving the asynchronous problem that has bothered the member of Scpos for about two million years. The inspiration of this super high-level class is the Promise in es6. With the await/async, the convenience it brings can be more violent and stimulating.

The Scpos Process can not only run under Node.js, but also be used in HTML page development. The oldest browser it support is IE5 (ES3).

Import

  • NodeJS

    const scpoProce = require('scpo-proce');
    // Or
    import scpoProce from 'scpo-proce';
  • HTML

    <!--[if IE]><script src="scpo-proce/es3.js"><![endif]-->
    <script src="scpo-proce/main.js"></script>
    <!--[if IE]></script><![endif]-->
    /// <reference path="scpo-proce/global.d.ts" />
    
    console.log(scpoProce);

Tips

  • The behavior of Scpos Process is different from ES6 Promise. ScpoProce.then is Not a microtask like Promise.then. Sometimes, callbacks in ScpoProce.then are more like being executed synchronically.

    setTimeout(() => console.log(1));
    
    new Promise((resolve) => {
      console.log(2);
      resolve();
    }).then(() => {
      console.log(3);
    });
    
    console.log(4);
    
    // Promise.then is a microtask.
    // The output will be "2431".
    import scpoProce from 'scpo-proce';
    
    setTimeout(() => console.log(1));
    
    scpoProce((resolve) => {
      console.log(2);
      resolve();
    }).then(() => {
      console.log(3);
    });
    
    console.log(4);
    
    // Just like sync, not a microtask.
    // The output will be "2341".

Experience After Use

  • Pretty convenient.

  • Quite magical because of its enigmatic performance that seems even better than ES6 Promise.

  • Troubling when my callback throwing the error, because there are too many scpoProce's function in the error tracking log.

    I don't know how the Promise solve this problem. Maybe Promise is achieved by the engine rather than JS codes.

More

  • In fact, this project is made by Scpos Web-Request. If you are doing HTML development, The Scpos Web-Request is the better choice, including the delivery of parameter that more eerie, the preset configuration that more comprehensive and so on.

    (But it haven't updated for about two hundred years.)