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

@franzzemen/re-commonjs-examples

v0.0.6

Published

Examples on integrating ES module loaded re framework into commonjs

Downloads

2

Readme

Read Me

This provides an example on how to use the ES module loaded packages in the re framework from a commonjs loaded source project.

Installation

To run:

From any folder, noting that this will create the subdirectory node_modules

npm i @franzzemen/re-commonjs-examples

Run it

node ./node_modules/@franzzemen/re-commonjs-examples/index.js

Or create an index.js file in the folder you ran npm from.

index.js:

// Start index.js
require('@franzzemen/re-commonjs-examples');
// End

And run it:

node

The simple act of loading the package will run the top example and output to the console.

You can inspect the Javascript code at ./node_modules/@franzzemen/re-commonjs-examples/index.js. However you may prefer working with original source, especially if you know typescrip. See next section.

Building the code

You can build the git project to run as is, or use the build scaffolding for your own uses. For more information on how to use the scaffolding, see the documentation for @franzzemen/gulp-base. For simple purposes:

Make sure you have properly installed:

  • git (most versions should work, but use latest available)
  • node & npm (node 16.x+, npm 8.x+)
  • typescript (4.8.x+ was the earliest tested, may work on earlier versions)
  • gulp-cli (global, most recent or 2.3.0+)

Then execute:

Fetch the project and cd into it:

git clone https://github.com/FranzZemen/re-commonjs-examples
cd ./re-commonjs-examples

Install local dependencies

npm i

Build and test (all the test does is run the index file)

gulp

You can also run it

node publish 

If you're just rebuilding and running the test(s):

gulp buildTest

Output

The main output from the index.js file loading should look similar to:

 2022-10-16T20:56:19.348 INFO:
{
  message: 'Result',
  data: {
    applicationResults: [
      {
        applicationRef: 'Default',
        ruleSetResults: [
          {
            ruleSetRef: 'Default',
            ruleSetText: '',
            ruleResults: [
              RuleResult {
                _result: {
                  ruleRef: 'Rule 2022-10-16T16:56:19:eee80659-a852-42a0-b94a-260244907229',
                  ruleText: '',
                  logicalConditionResult: { logicalOperator: 'and', result: true }
                }
              }
            ],
            valid: true
          }
        ],
        valid: true
      }
    ],
    valid: true
  }
}