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

xode

v0.0.3

Published

> Create a customized node binary with additional features

Downloads

5

Readme

xode

Create a customized node binary with additional features

The xode project is a hackable, customizable binary that wraps node and adds additional features to it. The additional features are:

  • Native support for modern ECMAScript syntax.
  • Native support for ECMAScript Modules in .js files (via a CommonJS transform).
  • Native support for parsing flow, TypeScript and React JSX syntax.
    • Note that xode doesn't do any type-checking; it's just able to parse the additional syntax added by flow and TypeScript.
  • Additional builtin modules (if you wish). You can add any module from npm as an additional builtin module, and then you don't need to install it from npm; it'll be built-in to xode.

The xode project is built on top of nexe.

Use-cases

  • Execute flow and typescript code without a build step
  • Quickly prototype ideas using your favorite tools and npm packages, without needing to npm install
  • Bundle up your node_modules as builtins and run scripts in CI without needing to install node_modules

Try it out

To try out a xode binary based on node 12.16.2 with no additional builtin modules, you can install xode from npm:

npm install -g xode

Then, run it on the command line with the name of a script as its first argument:

xode myscript.ts

Compiling a xode binary (no customizations)

  1. Clone the repo and open it.
  2. Run npm install.
  3. Run npm run build.
  4. xode binaries will be created in the build folder.

Customizing the base node version

  1. Clone the repo and open it.
  2. Run npm install.
  3. Edit node-version.js to whichever version of node you want your xode binary to be based on.
  4. Run npm run build.
  5. xode binaries based off of your specified node version will be created in the build folder.

Adding additional builtin modules from npm

  1. Clone the repo and open it.
  2. Run npm install.
  3. Use npm to install additional packages you'd like to add as builtins. I recommend you install them as non-dev dependencies, so you can tell them apart from dependencies internal to xode itself.
  4. Edit xode/builtins.js and add your additional packages to the xodeBuiltins object near the bottom of the file, using the example comment as a guide.
  5. Run npm run build.
  6. xode binaries with your additional builtin modules will be created in the build folder.

Adding support for additional native syntax features

xode uses babel internally to compile your source code to normal JavaScript right before it's run. By modifying the babel configuration xode uses, you can add support for additional syntax features.

  1. Clone the repo and open it.
  2. Run npm install.
  3. Use npm to install any additional babel transforms you'd like xode to have built-in.
  4. If desired, upgrade the existing babel packages xode uses to their latest versions.
  5. Add the transforms you installed to xode/compile.js.
  6. Run npm run build.
  7. xode binaries that use your customized babel configuration will be created in the build folder.

Caveats

If you add builtin modules that use native code, you'll notice that a node_modules folder containing .node files gets created next to the xode/xode.exe binary in your build folder. You need to keep this node_modules folder next to the xode/xode.exe file for the native code to work correctly.

License

MIT