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

demeteorizer

v4.3.0

Published

Converts a Meteor app into a "standard" Node.js application.

Downloads

57

Readme

Demeteorizer

NPM version Build Status

CLI tool to convert a Meteor app into a "standard" Node.js application. The resulting app contains a package.json file with all required dependencies and can be easily ported to your own servers or Node.js PAAS providers.

Note that version 3 of Demteorizer changes the output structure, which may cause issues depending on how/where you are deploying your application. With the new structure, the generated node application is available in bundle/programs/server.

How Demeteorizer Works

Demeteorizer bundles your Meteor application using meteor build then updates the generated package.json to include all of the necessary properties for running the application on a PaaS provider.

Installing

Install Demeteorizer globally using npm

$ npm install -g demeteorizer

Usage

$ cd /path/to/meteor/app
$ demeteorizer [options]

-h, --help                 output usage information
-V, --version              output the version number
-o, --output <path>        Output folder for converted application [.demeteorized]
-a, --architecture <arch>  Build architecture to be generated
-d, --debug                Build the application in debug mode (don't minify, etc)
-j, --json <json>          JSON data to be merged into the generated package.json

Windows Support

Demeteorizer works on Windows; however, errors will occur when repeatedly running demeteorizer in Node.js versions prior to 0.12.4.

The workaround on earlier versions on Node.js is to delete to generated .demeteorized directory before rerunning demeteorizer.

Meteor 0.8.1 and Below

Meteor version 0.8.1 and below are only supported in Demeteorizer version v0.9.0 and Modulus CLI v1.1.0. For all other versions, use the latest version of Demeteorizer.

This is because the bundle command changed in 0.9 which makes backward compatibility impossible. :(

Running Resulting Application

Meteor applications make use of the following environment variables:

  1. MONGO_URL='mongodb://user:password@host:port/databasename?autoReconnect=true'
  2. ROOT_URL='http://example.com'
  3. MAIL_URL='smtp://user:password@mailhost:port/' (optional)
  4. PORT=8080 (optional, defaults to 80)

Note that demeteorized applications still require a MongoDB connection in order to correctly run. To run your demeteorized application locally, you will need MongoDB installed and running.

Run the app:

$ cd /your/output/directory/bundle/programs/server
$ npm install
$ MONGO_URL=mongodb://localhost:27017/test PORT=8080 ROOT_URL=http://localhost:8080 npm start

Examples

Convert the Meteor app in the current directory and output to ./.demeteorized

$ demeteorizer

Convert the Meteor app in the current directory and output to ~/meteor-app/converted

$ demeteorizer -o ~/meteor-app/converted

The following steps will create a Meteor example app, convert it, and run it.

$ meteor create --example leaderboard
$ cd leaderboard
$ demeteorizer
$ cd .demeteorized/bundle/programs/server
$ npm install
$ MONGO_URL=mongodb://localhost:27017/test PORT=8080 ROOT_URL=http://localhost:8080 npm start

Visit http://localhost:8080 in your browser.

Modifying the Generated package.json

The --json option will allow you to pass arbitrary JSON data that will be added to the generated package.json. You can use this to override settings in package.json or to add arbitrary data.

settings.json

{
  "settings": {
    "key": "some-key-data",
    "services": {
      "some-service": {
        "key": "another-key"
      }
    }
  }
}

Add settings.json data to the generated package.json

$ demeteorizer --json "$(cat settings.json)"

The resulting package.json will have a settings property that includes the JSON from settings.json.

You can also use this to override settings

$ demeteorizer --json "{ \"engines\": { \"node\": \"0.12.x\" } }"

This will result in a package.json with the node engine set to 0.12.x.

Debug

The --debug option is passed to the meteor build command indicating to meteor that the application should not be minified.

$ demeteorizer --debug

Support

Demeteorizer has been tested with the current Meteor example apps. If you find an app that doesn't convert correctly, throw an issue in Github - https://github.com/onmodulus/demeteorizer/issues

Release History

See releases.

License

The MIT License (MIT)

Copyright (c) 2015 Modulus

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.