Skip to content

mappum/proxmise

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

Proxmise

proxmise is short for "proxied Promise". It lets you create an object where arbitrary keys can be accessed asynchronously.

Installation

Requires node v7.6.0 or higher.

$ npm install proxmise

Usage

let Proxmise = require('proxmise')

// define a getter func
let prox = Proxmise((path, resolve, reject) => {
  // if `prox.foo.bar` is accessed, path will be [ 'foo', 'bar' ]
  resolve(path.join('.'))
})

console.log(await prox.this.is.the.path)
// -> 'this.is.the.path'
// you can also use an async function
let prox = Proxmise(async (path) => path)

License

MIT

About

Proxied Promises - Create async getters for arbitrary object paths

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published