Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dojo/core
:rocket: Dojo 2 - language helpers and utilities.
https://github.com/dojo/core
dojo2 language-utilities typescript
Last synced: about 2 months ago
JSON representation
:rocket: Dojo 2 - language helpers and utilities.
- Host: GitHub
- URL: https://github.com/dojo/core
- Owner: dojo
- License: other
- Archived: true
- Created: 2015-03-06T21:44:31.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-07-30T12:21:49.000Z (almost 6 years ago)
- Last Synced: 2024-04-09T21:10:42.975Z (3 months ago)
- Topics: dojo2, language-utilities, typescript
- Language: TypeScript
- Homepage: http://dojo.io
- Size: 1.88 MB
- Stars: 213
- Watchers: 55
- Forks: 62
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Lists
- awesome-dojo - Dojo core - Dojo 2 package containing TypeScript and JavaScript core utilities (Packages, libraries and scripts)
README
## The `@dojo/core` repository has been deprecated and merged into [`@dojo/framework`](https://github.com/dojo/framework)
You can read more about this change on our [blog](https://dojo.io/blog/). We will continue providing patches for `core` and other Dojo 2 repositories, and a [CLI migration tool](https://github.com/dojo/cli-upgrade) is available to aid in migrating projects from v2 to v3.
***
# Dojo 2 core
[![Build Status](https://travis-ci.org/dojo/core.svg?branch=master)](https://travis-ci.org/dojo/core)
[![codecov.io](https://codecov.io/github/dojo/core/coverage.svg?branch=master)](https://codecov.io/github/dojo/core?branch=master)
[![npm version](https://badge.fury.io/js/%40dojo%2Fcore.svg)](https://badge.fury.io/js/%40dojo%2Fcore)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fdojo%2Fcore.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fdojo%2Fcore?ref=badge_shield)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.## Usage
To use `@dojo/core`, install the package along with its required peer dependencies:
```bash
npm install @dojo/core# peer dependencies
npm install @dojo/has
npm install @dojo/shim
```## Features
- [Feature Detection](#feature-detection)
- [Language Utilities](#language-utilities)
- [lang](#lang)
- [load](#load)
- [string](#string)
- [UrlSearchParams](#urlsearchparams)
- [Event Handling](#event-handling)
- [HTTP Requests](#http-requests)
- [Promises and Asynchronous Operations](#promises-and-asynchronous-operations)
- [Promise](#promise)
- [Task](#task)### 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`](docs/has.md) 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.#### lang
The [`@dojo/core/lang` module](docs/lang.md) contains various utility functions for tasks such as copying objects
and creating late-bound or partially applied functions.### load
The [`@dojo/core/load` module](docs/load.md) can be used to dynamically load modules or other arbitrary resources via plugins.#### string
The [`@dojo/core/stringExtras` module](docs/stringExtras.md) contains various string functions that are not available as part of the ES2015 String APIs.
#### UrlSearchParams
The [`@dojo/core/UrlSearchParams` class](docs/UrlSearchParams.md) can be used to parse and generate URL query strings.
#### Event handling
The [`@dojo/core/on` module](docs/on.md) 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](docs/request.md) 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.
### Code Style
This repository uses [`prettier`](https://prettier.io/) for code styling rules and formatting. A pre-commit hook is installed automatically and configured to run `prettier` against all staged files as per the configuration in the project's `package.json`.
An additional npm script to run `prettier` (with write set to `true`) against all `src` and `test` project files is available by running:
```bash
npm run prettier
```### 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](https://theintern.github.io) 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–2018 [JS Foundation](https://js.foundation/) & contributors. [New BSD](http://opensource.org/licenses/BSD-3-Clause) license.
Some string functions (`codePointAt`, `fromCodePoint`, and `repeat`) adopted from polyfills by Mathias Bynens,
under the [MIT](http://opensource.org/licenses/MIT) license.See [LICENSE](LICENSE) for details.
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fdojo%2Fcore.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fdojo%2Fcore?ref=badge_large)