Socket
Socket
Sign inDemoInstall

ember-get-config

Package Overview
Dependencies
307
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ember-get-config

Get `config/environment` from anywhere, even addons!!!


Version published
Weekly downloads
154K
increased by1.83%
Maintainers
2
Install size
29.5 MB
Created
Weekly downloads
 

Readme

Source

npm version GitHub Actions Build Status

ember-get-config

Gaining access to an app's config file from an addon can be challenging. If possible, you should always get it through the container like so:

export default Ember.Component.extend({
  someFunction() {
    const config = Ember.getOwner(this).resolveRegistration('config:environment');
    . . . .
  }
});

If you do not have access to the container though, you can always use ember-get-config.

Installation

ember install ember-get-config

Usage

Simply:

import config from 'ember-get-config';

Which allows you to do handy things like:

const { environment, modulePrefix } = config;

Boom!

Contributing

See the Contributing guide for details.

Keywords

FAQs

Last updated on 01 Jul 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc