• Stars
    star
    741
  • Rank 60,779 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 11 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A basic but performant promise implementation.

lie

Promises/A+ logo Build status

lie is a small, performant promise library implementing the Promises/A+ spec (Version 1.1).

Originally a fork of Ruben Verborgh's promiscuous, with version 2.6 it became a fork of ayepromise by Chris Burgmer.

npm install lie
var Promise = require('lie');
// or use the pollyfill
require('lie/polyfill');

Usage

Either use it with browserify (recommended) or grab one of the files from the dist folder:

  • lie.js/lie.min.js exposes 'Promise' either as a UMD module or from the global scope, depending on if a CJS or AMD loader is available.
  • lie.polyfill.js/lie.polyfill.min.js adds 'Promise' to the global scope only if it's not already defined (not a UMD).

API

Implements the standard ES6 api:

new Promise(function(resolve, reject){
    doSomething(function(err, result) {
        if (err) {
            reject(err);
        } else {
            resolve(result);
        }
    });
}).then(function (value) {
    //on success
}, function (reason) {
    //on error
}).catch(function (reason) {
    //shortcut for error handling
});

Promise.all([
    //array of promises or values
]).then(function ([/* array of results */]));

Promise.race([
    //array of promises or values
]);
// either resolves or rejects depending on the first value to do so

Unhandled Rejections

In Node.js, lie emits an unhandledRejection event when a rejected promise isn't caught, in line with how io.js does it. This allows it to act as a promise shim in both Node.js and the browser.

More Repositories

1

shapefile-js

Convert a Shapefile to GeoJSON. Not many caveats.
JavaScript
651
star
2

catiline

JavaScript library to take the pain out of web workers.
JavaScript
579
star
3

copyfiles

copy files on the command line
JavaScript
386
star
4

leaflet-ajax

plugin for leaflet for ajax
JavaScript
353
star
5

crypto-pouch

plugin for encrypted pouchdb/couchdb databases
JavaScript
242
star
6

leaflet.shapefile

Shapefile in Leaflet
JavaScript
242
star
7

tap-nyan

tap -> nyan
JavaScript
146
star
8

immediate

cross browser microtask
JavaScript
146
star
9

rollup-plugin-node-builtins

JavaScript
137
star
10

topojson.py

Topojson ported to python
Python
92
star
11

rollup-plugin-node-globals

JavaScript
90
star
12

SQLdown

sql backend for levelup
JavaScript
72
star
13

fileGDB.js

parse a file GDB
JavaScript
67
star
14

derequire

remove require statements without breaking scope
JavaScript
65
star
15

leaflet.filegdb

use an ESRI file geodatabase in leaflet
JavaScript
49
star
16

leaflet.pouch

PouchDB layer for leaflet
JavaScript
38
star
17

chacha20poly1305

chacha20/poly1305 with the node api
JavaScript
38
star
18

esri2geo

Converts ESRI json to geojson
JavaScript
38
star
19

leaflet.d3

leaflet + d3
JavaScript
34
star
20

leaflet.demos

Some demos for leaflet
JavaScript
32
star
21

native-crypto

crypto that should work in both the browser and in node using native modules where available
JavaScript
31
star
22

process-nextick-args

process.nextTick always accepts args, always
JavaScript
31
star
23

pouch-dat

replicate from pouch to dat
JavaScript
23
star
24

PouchStream

use some streams with your pouches
JavaScript
20
star
25

node-lfu-cache

JavaScript
19
star
26

leaflet.workspace

a quick and dirty workspace for you.
JavaScript
19
star
27

level-tree

R-tree spatial index for GeoJSON in LevelDB
JavaScript
18
star
28

minimalistic-assert

JavaScript
18
star
29

mbliberator

liberate your mbtiles from the tyranny of sqlite
JavaScript
17
star
30

simplify-rs

Rust
15
star
31

set.up

functional tools for es6 sets
JavaScript
13
star
32

esri2topo

Python
12
star
33

buffer-shims

JavaScript
12
star
34

medium

Like Big but less so
JavaScript
11
star
35

CodeForBoston-Census

Repo for the census group.
JavaScript
11
star
36

noms

easily make noms for your other streams to consume
JavaScript
10
star
37

ltcdr

like commander, but accepting pull requests
JavaScript
10
star
38

deckpad

presentations made easier
JavaScript
10
star
39

MassGIS

MassGIS -> Open
10
star
40

async-iter-stream

streams as asyncIterators
JavaScript
9
star
41

leaf-couch

leaflet in the front, couchdb in the back
JavaScript
9
star
42

macrotask

A cross browser macrotask library
JavaScript
9
star
43

es6-stream

streams, but with generators
JavaScript
9
star
44

parseDBF

JavaScript
9
star
45

streams-a-love-story

Node Interactive talk entitled Streams and You: A Love Story
HTML
8
star
46

rollup-config-cjs

JavaScript
8
star
47

esri2gist

Make Gists inside Arcmap
Python
8
star
48

buffer-es6

es6 port of browserify buffer
JavaScript
7
star
49

async-rtree

An async rtree
JavaScript
6
star
50

web-worker

make web workers from strings in many browsers
JavaScript
6
star
51

cabs

Content Addressable Blob Store
JavaScript
6
star
52

proj4geojson

JavaScript
6
star
53

chacha-native

node bindings for chacha20 in c
C++
6
star
54

liar

A modular collection of tools for asynchronous programing via promises
JavaScript
6
star
55

coshp

Cloud Optimized Shapefiles
JavaScript
5
star
56

jsgeo

Calvin's js.geo presentation
JavaScript
5
star
57

rollup-plugin-auto-transform

JavaScript
5
star
58

cw.ajax

ajax plugin
JavaScript
5
star
59

name-me

come up with a name for your npm package
JavaScript
5
star
60

salsa20

JavaScript
5
star
61

inline-process-browser

inline references to 'process.browser' to 'true'
JavaScript
5
star
62

es6-translate

Yo dawg I heard you liked modules, so I made a module to translate your modules into modules.
JavaScript
5
star
63

spider-stream

recursively get files in a directory and sub directories, as a stream
JavaScript
4
star
64

nontree

geohashes, but turned up to 102 in ternary
JavaScript
4
star
65

vector-layers

vector layers in leaflet
JavaScript
4
star
66

flaming-wight

pouch demo from my blog
JavaScript
4
star
67

node-process-es6

JavaScript
4
star
68

SBS

Sync Buffer Stream: A stream that synchronously buffers and then drains on the next tick
JavaScript
4
star
69

geojson-assert

assert stuff about geojson (well just one thing)
JavaScript
4
star
70

shp-write-stream

stream write shapefiles, sorta
JavaScript
4
star
71

leaflet.css

moved
JavaScript
3
star
72

io-stream

iojs-core streams for userland
JavaScript
3
star
73

cloud-pubsub

JavaScript
3
star
74

crypto-stream

streaming authenticated encryption stream
JavaScript
3
star
75

pem2jwk

JavaScript
3
star
76

leaflet.sprite

moved
CoffeeScript
3
star
77

sublevel-migrate

migrate v5 sublevels to v6
JavaScript
3
star
78

create-cipher

the node ciphers you always wanted
JavaScript
3
star
79

kublai

express + tilelive + cats
JavaScript
3
star
80

projections-in-web-browsers-are-terrible-and-you-should-be-ashamed-of-yourself

I have opinions
JavaScript
3
star
81

kubernetes-scripts

JavaScript
2
star
82

csr

JavaScript
2
star
83

lie-parallel

JavaScript
2
star
84

express-simple-auth-token

JSON web token middleware for express designed to work with Ember Simple Auth Token
JavaScript
2
star
85

pouchdb-topromise

JavaScript
2
star
86

leaflet-workshop

workshop at avidgeo
JavaScript
2
star
87

maptime-git

JavaScript
2
star
88

k3

JavaScript
2
star
89

deckdemo

JavaScript
2
star
90

parcel-map

JavaScript
2
star
91

FieldMapping

tools for dealing with arcpy field mapping
Python
2
star
92

intercal

TODO port to JS
C
2
star
93

service-account

sugar for easier access to google service account keys
JavaScript
2
star
94

cartodb-console

JavaScript
2
star
95

cw.mapReduce

JavaScript
2
star
96

hmac-stream

streaming HMACs
JavaScript
2
star
97

ppp

2
star
98

offline-talk

HTML
1
star
99

pouchdb-promise

JavaScript
1
star
100

cwm

JavaScript
1
star