Skip to content

Commit 3d32e92

Browse files
Moved the "ono" package to the @jsdevtools scope
1 parent bb918d3 commit 3d32e92

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ ono (Oh No!)
55
[![Build Status](https://github.com/JS-DevTools/ono/workflows/CI-CD/badge.svg)](https://github.com/JS-DevTools/ono/blob/master/.github/workflows/CI-CD.yaml)
66
[![Coverage Status](https://coveralls.io/repos/github/JS-DevTools/ono/badge.svg?branch=master)](https://coveralls.io/github/JS-DevTools/ono)
77

8-
[![npm](https://img.shields.io/npm/v/ono.svg)](https://www.npmjs.com/package/ono)
8+
[![npm](https://img.shields.io/npm/v/@jsdevtools/ono.svg)](https://www.npmjs.com/package/@jsdevtools/ono)
99
[![Dependencies](https://david-dm.org/JS-DevTools/ono.svg)](https://david-dm.org/JS-DevTools/ono)
10-
[![License](https://img.shields.io/npm/l/ono.svg)](LICENSE)
10+
[![License](https://img.shields.io/npm/l/@jsdevtools/ono.svg)](LICENSE)
1111

1212
[![OS and Browser Compatibility](https://jstools.dev/img/badges/ci-badges-with-ie.svg)](https://github.com/JS-DevTools/ono/blob/master/.github/workflows/CI-CD.yaml)
1313

@@ -33,7 +33,7 @@ Example
3333
--------------------------
3434

3535
```javascript
36-
const ono = require("ono");
36+
const ono = require("@jsdevtools/ono");
3737

3838
// Throw an error with custom properties
3939
throw ono({ code: "NOT_FOUND", status: 404 }, `Resource not found: ${url}`);
@@ -54,7 +54,7 @@ throw ono.syntax(...); // SyntaxError
5454
throw ono.reference(...); // ReferenceError
5555

5656
// Create an Ono method for your own custom error class
57-
const { Ono } = require("ono");
57+
const { Ono } = require("@jsdevtools/ono");
5858
class MyErrorClass extends Error {}
5959
ono.myError = new Ono(MyErrorClass);
6060

@@ -79,13 +79,13 @@ Usage
7979
When using Ono in Node.js apps, you'll probably want to use **CommonJS** syntax:
8080

8181
```javascript
82-
const ono = require("ono");
82+
const ono = require("@jsdevtools/ono");
8383
```
8484

8585
When using a transpiler such as [Babel](https://babeljs.io/) or [TypeScript](https://www.typescriptlang.org/), or a bundler such as [Webpack](https://webpack.js.org/) or [Rollup](https://rollupjs.org/), you can use **ECMAScript modules** syntax instead:
8686

8787
```javascript
88-
import ono from "ono";
88+
import ono from "@jsdevtools/ono";
8989
```
9090

9191

@@ -152,7 +152,7 @@ The `Ono` constructor takes an optional options object as a second parameter. Th
152152
When wrapping an error, Ono's default behavior is to append the error's message to your message, with a newline between them. For example:
153153

154154
```javascript
155-
const ono = require("ono");
155+
const ono = require("@jsdevtools/ono");
156156

157157
function createArray(length) {
158158
try {
@@ -178,7 +178,7 @@ Invalid array length;
178178
If you'd rather not include the original message, then you can set the `concatMessages` option to `false`. For example:
179179

180180
```javascript
181-
const { ono, Ono } = require("ono");
181+
const { ono, Ono } = require("@jsdevtools/ono");
182182

183183
// Override the default behavior for the RangeError
184184
ono.range = new Ono(RangeError, { concatMessages: false });
@@ -248,7 +248,7 @@ Here are some compatible polyfill libraries:
248248
If the standard [`util.format()`](https://nodejs.org/api/util.html#util_util_format_format_args) functionality isn't sufficient for your needs, then you can set the `format` option to your own custom implementation. Here's a simplistic example:
249249

250250
```javascript
251-
const { ono, Ono } = require("ono");
251+
const { ono, Ono } = require("@jsdevtools/ono");
252252

253253
// This is a simple formatter that replaces $0, $1, $2, ... with the corresponding argument
254254
let options = {
@@ -281,7 +281,7 @@ Custom Error Classes
281281
Ono has built-in support for all of [the built-in JavaScript Error types](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types). For example, you can use `ono.reference()` to create a `ReferenceError`, or `ono.syntax()` to create a `SyntaxError`. In addition to the built-in types, you can also create Ono methods for your own custom error classes.
282282

283283
```javascript
284-
const { ono, Ono } = require("ono");
284+
const { ono, Ono } = require("@jsdevtools/ono");
285285
let counter = 0;
286286

287287
// A custom Error class that assigns a unique ID and timestamp to each error

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "ono",
2+
"name": "@jsdevtools/ono",
33
"version": "6.0.1",
44
"description": "Throw better errors.",
55
"keywords": [

0 commit comments

Comments
 (0)