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

jscad-includify

v1.1.0

Published

Build the includes for your JSCAD project down into one file

Downloads

2

Readme

jscad-includify

Build Status Greenkeeper badge

Build the includes for your JSCAD project down into one file. Helpful for distributing a utility library or a project as a single file.

This module can be used both as a CLI tool and as a node module.

CLI Tool

Install

$ npm install -g jscad-includify

Usage

$ jscad-includify <input file> [output file]

Examples

To build the includes for logo.jscad and then output the result to stdout:

$ jscad-includify logo.jscad

Or to build the includes for logo.jscad and then save the result in logo.built.jscad:

$ jscad-includify logo.jscad logo.built.jscad

Node Module

Install

$ npm install --save jscad-includify

API

includify.run(code[, basePath][, callback])

  • code string: String of code you wish to includify
  • basePath string: Path to use as the base for the includes. Defaults to an empty string
  • callback function: Function to be excuted when either an error is encountered or execution has completed. The callback is called with these parameters:
    • error error: If there was an error this will be the error object
    • includes array: Array of file paths that were included
    • code string: String of includified code

If callback is ommitted then a promise is returned. If there is an error, the promise will be rejected with the error object. If the execution is successful, the promise will be fulfilled with an object containing the following:

  • includes array: Array of file paths that were included
  • code string: String of includified code
Examples
// Callback example
includify.run(jscadString, (error, includes, code) => {
    ...
});

// Promise example
includify.run(jscadString).then((includes, code) => {
    ...
}).catch((error) => {
    ...
});

includify.runFile(inputPath[, outputPath][, callback])

  • inputPath string: Path to the file you wish to includify
  • outputPath string: Path where the output is to be saved
  • callback function: Function to be excuted when either an error is encountered or execution has completed. The callback is called with these parameters:
    • error error: If there was an error this will be the error object
    • includes array: Array of file paths that were included
    • code string: String of includified code

If callback is ommitted then a promise is returned. If there is an error, the promise will be rejected with the error object. If the execution is successful, the promise will be fulfilled with an object containing the following:

  • includes array: Array of file paths that were included
  • code string: String of includified code
Examples
// Callback example excluding output path
includify.runFile(`logo.jscad`, (error, includes, code) => {
    ...
});

// Callback example with output path
includify.runFile(`logo.jscad`, `logo.built.jscad`, (error, includes, code) => {
    ...
});

// Promise example with output path
includify.runFile(`logo.jscad`).then((includes, code) => {
    ...
}).catch((error) => {
    ...
});

// Promise example excluding output path
includify.runFile(`logo.jscad`, `logo.built.jscad`).then((includes, code) => {
    ...
}).catch((error) => {
    ...
});

License

MIT © Luke Bonaccorsi