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 🙏

© 2026 – Pkg Stats / Ryan Hefner

jnclude

v0.1.1

Published

JavaScript utilite for including files and excluding blocks

Readme

jnclude

Документация на русском

Jnclude builds the application file from a several source files and cuts a sections of the code what don't used in application production version. Using flags allow to create application files with different logic or leave special debug code for testing certain algorithm.

Getting started

  1. Install node.js
  2. Run command:
npm install jnclude -g
  1. For get help of using jnclude run:
jnclude -h
  1. To run jnclude, you can use the following command:
jnclude -in=path/source.js -out=path/destination.js [options]

Console Options

-in=/path/src_name - Main source file name.

-out=/path/dest_name - Destination file name. If path of destination not specified, file creates in the source folder. But if source path contain file with specified name, jnclude returns error.

-flag="flag_1 [other_flags]" - Activate including or excluding for blocks marked with flags. If the flags option is given, directives without flag or other flags don't work.

-develop - If develop option is given all exclude directives don't work

-fullinfo - Shows detail information after building:

Jnclude done!
Done: 449.801ms
CPU usage:  { user: 15000, system: 0 }
Memory usage:
 { rss: 20500480,
  heapTotal: 8421376,
  heapUsed: 3805416,
  external: 8380 }
Loaded files:
    src/core.js - 1 times
    src/source.js - 1 times

without -fullinfo

Jnclude done!
Loaded files:
    src/core.js - 1 times
    src/source.js - 1 times

Directives

  1. include - copy the given file content and put it instead directive with offsets from line begin
    //>include(002.js) dev pro
____|_________|______| _______
 1        2      3        4

where: 1 - offset, 2 - command, 3 - source file name, 4 - flags

  1. include_once - checks that this file not used by jnclude earlier and copy the given file content and put it instead directive. If used file earlier directive ignored.
    //>include_once(002.js) dev
  1. exclude - remove code beetween exclude and /exclude if not given -develop option.
    //>exclude pro
        alert(error);
    //>/exclude

Run example

jnclude -in=src/main.js -out=build/result.js
jnclude -in=src/main.js -out=build/result.js -develop -flag="dev_1 dev_2 pro"
jnclude -in=src/main.js -out=build/result.js -flag="pro" -fullinfo

Examples

sample/main.js

console.log(1);
//>include(add.js) dev
    //>exclude pro
        console.log(4);
    //>/exclude
//>include_once(add.js) dev pro

sample/add.js

console.log(2);
//>include_once(appendix.js) dev

sample/appendix.js

    console.log(3);

run jnclude -in=sample/main.js -out=sample/result.js

sample/result.js

console.log(1);
console.log(2);
    console.log(3);   

run jnclude -in=sample/main.js -out=sample/result.js -develop

sample/result.js

console.log(1);
console.log(2);
    console.log(3);
        console.log(4);

run jnclude -in=sample/main.js -out=sample/result.js -flag="dev"

sample/result.js

console.log(1);
console.log(2);
    console.log(3);
        console.log(4);

run jnclude -in=sample/main.js -out=sample/result.js -flag="pro"

sample/result.js

console.log(1);
console.log(2);

Planned

  • [x] Excluding debug code
  • [ ] Including certain block in source files
  • [ ] Remove comments, console and alert(-noalert) calling
  • [ ] -noflag option - use directives without given flags
  • [ ] -log option - generation the comments with directive result description