org.dragly.experimental.quickly

Polyfills and core modules for emulating a Node.js environment in QML

version 0.0.6.1

To install:

❯ qpm install org.dragly.experimental.quickly

Quickly

Quickly is a QML/JS library offering additional classes and methods that are part of the ES6 JS spec that QML's JS framework does not have. In addition, it offers several of the core modules that Node.js has.

The Quickly library is designed to be used with QMLify to offer a Node.js-like ES6 environment for Javascript used in QML. However, in can be used by itself to add the additional classes, methods, and core modules to a QML project.

Check out the documentation for more details, usage, and API documentation.

Installation

Install using qpm:

qpm install com.sonrisesoftware.quickly

Usage

Here are some sample uses:

import QtQuick 2.4
import Quickly 0.1

Item {
    Component.onCompleted: {
        var set = new Polyfills.Set()
        set.add(4)
        set.add(2)
        set.add(4)
        console.log(set.size) // Prints 2

        var promise = new Promise.Promise(function(resolve, reject) {
            resolve("Why again did we need a promise here?")
        }).then(function(result) {
            console.log(result)
        })

        Http.fetch('http://www.google.com')
            .then(function(response) {
                return response.text()
            }).then(function(text) {
                console.log(text)
            })

        var url = Url.parse('http://www.google.com')
    }
}

Acknowledgements

Licensing

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

Author

Michael Spencer

Info
View on Github

License: MPL_2_0

Installs
Today 8
This week 8
This month 8
This year 8
Total 8
Dependencies

None.

Versions