Giter Club home page Giter Club logo

core's Introduction

Dojo 2 core

Build Status codecov.io npm version FOSSA Status

This package provides a set of language helpers, utility functions, and classes for writing TypeScript applications. It includes APIs for feature detection, asynchronous operations, basic event handling, and making HTTP requests.

WARNING This is beta software. While we do not anticipate significant changes to the API at this stage, we may feel the need to do so. This is not yet production ready, so you should use at your own risk.

Usage

To use @dojo/core, install the package along with its required peer dependencies:

npm install @dojo/core

# peer dependencies
npm install @dojo/has
npm install @dojo/shim

Features

Feature Detection

Using the latest Web technologies isn't always as straightforward as developers would like due to differing support across platforms. @dojo/core/has provides a simple feature detection API that makes it easy to detect which platforms support which features.

Language Utilities

The core package provides modules offering language utilities. Some of these are heavily based on methods in the ES2015 proposal; others are additional APIs for commonly-performed tasks.

array

The @dojo/core/array module contains analogues to some of the ES2015 Array APIs.

lang

The @dojo/core/lang module contains various utility functions for tasks such as copying objects and creating late-bound or partially applied functions.

load

The @dojo/core/load module can be used to dynamically load modules, or other arbitrary resources via plugins.

math

The @dojo/core/math module contains analogues to a number of ES2015 APIs, including many trigonometric and logarithmic functions.

string

The @dojo/core/stringExtras module contains various string functions that are not available as part of the ES2015 String APIs.

UrlSearchParams

The @dojo/core/UrlSearchParams class can be used to parse and generate URL query strings.

Event handling

The @dojo/core/on module contains methods to handle events across types of listeners. It also includes methods to handle different event use cases including only firing once and pauseable events.

HTTP requests

The @dojo/core/request module contains methods to simplify making http requests. It can handle making requests in both node and the browser through the same methods.

Promises and Asynchronous Operations

Promise

The @dojo/core/Promise class is an implementation of the ES2015 Promise API that also includes static state inspection and a finally method for cleanup actions.

@dojo/core/async contains a number of classes and utility modules to simplify working with asynchronous operations.

Task

The @dojo/core/async/Task class is an extension of @dojo/core/Promise that provides cancelation support.

How Do I Contribute?

We appreciate your interest! Please see the Dojo 2 Meta Repository for the Contributing Guidelines and Style Guide.

Installation

To start working with this package, clone the repository and run npm install.

In order to build the project run grunt dev or grunt dist.

Testing

Test cases MUST be written using Intern using the Object test interface and Assert assertion interface.

90% branch coverage MUST be provided for all code submitted to this repository, as reported by istanbul’s combined coverage results for all supported platforms.

To test locally in node run:

grunt test

To test against browsers with a local selenium server run:

grunt test:local

To test against BrowserStack or Sauce Labs run:

grunt test:browserstack

or

grunt test:saucelabs

Licensing information

© 2004–2017 JS Foundation & contributors. New BSD license.

Some string functions (codePointAt, fromCodePoint, and repeat) adopted from polyfills by Mathias Bynens, under the MIT license.

See LICENSE for details.

FOSSA Status

core's People

Contributors

agubler avatar bitpshr avatar bryanforbes avatar devpaul avatar dylans avatar edhager avatar jacobroufa avatar jason0x43 avatar jdonaghue avatar kitsonk avatar kriszyp avatar lzhoucs avatar maier49 avatar matt-gadd avatar msssk avatar nicknisi avatar novemberborn avatar odoe avatar rishson avatar rorticus avatar tomdye avatar vansimke avatar xizhao avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.