Code Monkey home page Code Monkey logo

meteor-root's Introduction

support support

Meteor.rootPath

Get the path to currently running instance of Meteor application on a server.

Features:

  • 🤓 Compatibility with Windows, Linux, and MacOS environments;
  • 👨‍💻 Globally available Meteor.rootPath — absolute path to programs/server directory;
  • 👨‍💻 Globally available Meteor.absolutePath — absolute path to .meteor directory.

meteor-root atmosphere library

Installation

meteor add ostrio:meteor-root

Usage

const pathToFile = `${Meteor.rootPath}/directory/where/is/your/file.json`;

Returns absolute path to programs/server directory of your compiled application, without trailing slash.

const pathToFile = `${Meteor.absolutePath}/.meteor/local/build/programs/server/directory/where/is/your/file.json`;

Returns absolute path to .meteor directory of your compiled application, without trailing slash.

Note: Be aware of the path stored in Meteor.absolutePath, it points to the location where Meteor application is running. It isn't guaranteed to be the same path as the path of your project. For example, running Meteor in test-mode will return a path from a temporary location where it's running.

Special thanks

  • Thanks to @Konard for testing and maintaining Windows support.

Testing

  1. Clone this package
  2. In Terminal (Console) go to directory where package is cloned
  3. Then run:
# Default
meteor test-packages ./

# With custom port
meteor test-packages ./ --port 8888

# With local MongoDB and custom port
MONGO_URL="mongodb://127.0.0.1:27017/meteor-root-test" meteor test-packages ./ --port 8888

Support this project:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.