Skip to main content

A tool to merge an input file and all of its requirements into a single output file. Similar to Sprockets.

Project description

CodeHarvester is a lightweight tool for merging different files respecting the requirements which are stated in those files. It would be useful in Web development for concatenating multiple files together. Currently it supports only JS like requirement definitions, but it is easily extensible.

Installation

To install CodeHarvester simply do:

pip install codeharvester

This will install CodeHarvester package and the runner script (harvester.py) into /bin directory.

Usage

CodeHarvester can concatenate any type of files but currently understands only JS like notating. To specify a requirement just write in the file:

//= require anoter_file.js

another_file.js will be included in the same place it was defined. If the same requirement will appear anywhere else it will be skipped because it is already included.

For command line options run:

harvester.py –help

Example

fileA.js:

//= require fileB.js

// this will be skipped because fileC.js will be already loaded as a requirement of fileB.js //= require fileC.js

… fileA.js stuff …

fileB.js

//= require fileC.js

… fileB.js stuff …

fileC.js

… fileC.js stuff …

output_file.js

… fileC.js stuff … … fileB.js stuff … … fileA.js stuff …

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

CodeHarvester-0.0.2.tar.gz (5.0 kB view details)

Uploaded Source

File details

Details for the file CodeHarvester-0.0.2.tar.gz.

File metadata

File hashes

Hashes for CodeHarvester-0.0.2.tar.gz
Algorithm Hash digest
SHA256 d24c7e0a8e5a5300ba24b82965f9bb95e6666bc19605ca4ca2e8dd14b0c82dc6
MD5 80f28fa72610f9aa3a71b80e03284e91
BLAKE2b-256 8162880f1fe05b2b393130c87e2fd84cc7ff311b1b3d1ea983f6e1c2dbc8028f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page