1.0.10 • Published 5 years ago

@poppinss/application v1.0.10

Weekly downloads
11
License
MIT
Repository
github
Last release
5 years ago

Adonis application

circleci-image npm-image license-image

The application class for AdonisJs to know more about the environment and project structure of your AdonisJs applications.

Table of contents

Usage

Ideally you shouldn't be installing this module directly, since it is part of AdonisJs by default. However, installing module directly is helpful when testing AdonisJs specific addons.

npm i @poppinss/application

# Yarn
yarn add @poppinss/application

and then use it as follows:

import { Application } from '@poppinss/application'
import { Ioc } from '@adonisjs/fold'

const app = new Application(
  __dirname,
  new Ioc(),
  require('./adonisrc.json'),
  require('./package.json'),
)

The constructor takes 4 arguments, which you can fake during tests.

Argument positionDescription
1 (appRoot)The application root
2 (ioc)Instance of IoC container
3 (rcContents)Contents of .adonisrc.json file. You can also provide an empty object
4 (pkgFile)Pass the contents of package.json file. Required to pull the app name, version and so on

rcParser

The application instance will parse the contents of .adonisrc.json file. However, if you need the parser, you can access and use it as follows.

import { rcParser } from '@poppinss/application'
rcParser.parse(require('.adonisrc.json'))

API Docs

Following are the autogenerated files via Typedoc

Maintainers

Harminder virk

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago