Skip to main content

Run RequireJS (r.js) without node.

Project description

Run RequireJS (r.js) from Python without requiring Node or Rhino. Leverages PyMiniRacer plus a minimal JS environment to make r.js think it’s running in node.

Latest PyPI Release Release Notes License GitHub Stars GitHub Forks GitHub Issues

Travis Build Status Python Support


python-requirejs is available via PyPI:

pip install requirejs


import requirejs

        "name": "main",

Hopefully, all of the available build options for r.js will Just Work. If you find any discrepancies, please open a ticket to let us know.

This library is meant to be a drop-in replacement for node r.js -o, and is tested by comparing its output with that command. However, since the optimize API is being called as a function, you may need to set the working directory explicitly to avoid any unexpected differences in how relative paths are computed:

import requirejs
import json

with open('app/') as f:
    config = json.load(f)

    working_directory="app/"  # Unique to python-requirejs

Download files

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

Source Distribution

requirejs-0.2.2.tar.gz (237.1 kB view hashes)

Uploaded source

Built Distribution

requirejs-0.2.2-py3-none-any.whl (240.5 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page