Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cfware/require-later
ES6 Proxy object for delayed module require.
https://github.com/cfware/require-later
Last synced: 29 days ago
JSON representation
ES6 Proxy object for delayed module require.
- Host: GitHub
- URL: https://github.com/cfware/require-later
- Owner: cfware
- License: mit
- Created: 2017-04-08T21:13:05.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-25T21:05:47.000Z (about 7 years ago)
- Last Synced: 2024-10-31T17:46:14.175Z (about 2 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @cfware/require-later
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![MIT][license-image]](LICENSE)ES6 Proxy object for delayed module require.
### Install @cfware/require-later
```sh
npm i --save-dev @cfware/require-later
```## Usage
The below example shows appropriate use of this module to require `@cfware/gulp-serve`.
The purpose is to allow `gulp --tasks-simple` to run for shell completion without delay
caused by large chains of required modules.```js
'use strict';const gulp = require('gulp');
const $ = require('@cfware/require-later')(require, {
gulpServe: '@cfware/gulp-serve'
});gulp.task('serve', () => $.gulpServe({
ports: [8081, 0],
statics: {'/': 'test'},
redirects: {'/': '/my-app'},
}));
```## Running tests
The only test currently provided is eslint.
```sh
npm install
npm test
```[npm-image]: https://img.shields.io/npm/v/@cfware/require-later.svg
[npm-url]: https://npmjs.org/package/@cfware/require-later
[downloads-image]: https://img.shields.io/npm/dm/@cfware/require-later.svg
[downloads-url]: https://npmjs.org/package/@cfware/require-later
[license-image]: https://img.shields.io/github/license/cfware/require-later.svg