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

engify

v0.0.4

Published

tools for running the js in several engines - based on commons.js - browserify

Downloads

6

Readme

Build Status

#What's this?

Browserify transformation that add minimal support for running node.js projects in multiple JavaScript implementations:

  • node
  • browser
  • rhino
  • Nashorn
  • spidermonkey (https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey)
  • JavaScriptCore (http://webkit.org - safary)
  • ringojs (http://ringojs.org/)
  • v7

Particularly it adds support for non standard:

  • console.log
  • global object

Right now is just an idea and experiments

The objective is alsbeing able and test other javascript implementations other than just node and the browser. Let's see how well we can "program once" run everywhere in JavaScript works...

#Examples

Ultimately this project contains lots of example projects that will compile into a .js file that run on all above implementations.

They not only uses different npm libraries but also browserify tools and languages like es-6 babel, typescript, etc.

#Usage

Assuming you have a node.js working project:

npm install engify
browserify -t engify index.js -o output.js
rhino output.js
jsc output.js

#Libraries tested

The following are libraries that I were able to use in all implementations:

  • underscore
  • lodash
  • momentjs
  • esprima
  • escodegen
  • handlebars

#browserify transformations tested

In general all browserify transformations should work! :) - in my case they all worked:

  • hbsify
  • brfs
  • tsify
  • coffeeify
  • browserify-livescript

#Objectives

  • Be able to write code using npm and run it in all javascript implementations.
  • support some very basic apis in all the impls, like console.log and the global object.
  • try to run js libraries that currently support browser and node like underscore, momentjs, esprima, lodash, acorn, etc in the rest of the implementations.

#Interesting commands

#run tests - located at spec/ folder
npm test

#run a tool that compiles a project and run it in all the implementations: 
sh test-project.js projects/handlebars-test

#compile sample project test-src: into a bundle
node src/index.js --input test-src/index.js > static/output.js

#run in node
node output.js

#run in Nashorn
jjs output.js

#run in rhino
rhino output.js

#run in v7 [v7](https://github.com/cesanta/v7)
v7 output.js

#compile and run in the abobe in a single command: 
sh test/test1.sh

#execute them all
node static/output.js; rhino static/output.js ; jjs static/output.js ; v7 static/output.js

# measure time:
time node static/output.js; time rhino static/output.js ; time jjs static/output.js ; time v7 static/output.js

#Release Tests

On any commit we should make the following commands work:

git clone https://github.com/cancerberoSgx/engify.git
cd engify
npm install

cd test-src
npm install
cd ..    
sh test-project.sh test-src

This last command will build givven test-src/index.js into static/ folder and then run it with all supported engines in the command line.

#TODO /Misc

  • support browser!
  • try windows native javascript engines (http://superuser.com/questions/488763/how-to-run-js-file-from-a-command-line-on-windows)
  • move file ../../test-src/js-compat to separate project
  • put global and console.log in a commons-js module
  • bin program: engify my/project/services/service1.js > output.js
  • Should be a browserify transformation ? currently not just uses browserify js api. write it anyway : (from https://github.com/substack/browserify-handbook)
  • put test-src as a separate project
  • browserify experiment: load libraries in ssp-libraries files and be able to use require() directly in .ss / scripts. probably i need to use a browserify flag.
  • try writing client side suitescript & jquery using Function.prototype.toString