Skip to content

Commit

Permalink
Require Node.js 10
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Feb 22, 2020
1 parent 6fb0e67 commit 053eb8a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 18 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ language: node_js
node_js:
- '12'
- '10'
- '8'
3 changes: 0 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ declare const npmName: {
): Promise<Map<NameType, boolean>>;

InvalidNameError: typeof InvalidNameErrorClass;

// TODO: remove this in the next major version
default: typeof npmName;
};

export = npmName;
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ const request = async (name, options) => {

return false;
} catch (error) {
if (error.statusCode === 404) {
const {statusCode} = error.response;

if (statusCode === 404) {
return true;
}

if (isScopedPackage && error.statusCode === 401) {
if (isScopedPackage && statusCode === 401) {
return true;
}

Expand All @@ -79,8 +81,6 @@ const npmName = async (name, options = {}) => {
};

module.exports = npmName;
// TODO: remove this in the next major version
module.exports.default = npmName;

module.exports.many = async (names, options = {}) => {
if (!Array.isArray(names)) {
Expand Down
2 changes: 1 addition & 1 deletion license
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
"description": "Check whether a package or organization name is available on npm",
"license": "MIT",
"repository": "sindresorhus/npm-name",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=8"
"node": ">=10"
},
"scripts": {
"test": "xo && ava && tsd"
Expand All @@ -31,7 +32,7 @@
"taken"
],
"dependencies": {
"got": "^9.6.0",
"got": "^10.6.0",
"is-scoped": "^2.1.0",
"is-url-superb": "^3.0.0",
"lodash.zip": "^4.2.0",
Expand All @@ -44,8 +45,8 @@
"devDependencies": {
"aggregate-error": "^3.0.1",
"ava": "^2.1.0",
"tsd": "^0.7.1",
"tsd": "^0.11.0",
"unique-string": "^2.0.0",
"xo": "^0.24.0"
"xo": "^0.26.1"
}
}
4 changes: 0 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

> Check whether a package or organization name is available on npm

## Install

```
$ npm install npm-name
```


## Usage

```js
Expand Down Expand Up @@ -51,7 +49,6 @@ const npmName = require('npm-name');
})();
```


## API

### npmName(name, options?)
Expand Down Expand Up @@ -98,7 +95,6 @@ Type: `object`

Same as `npmName()`.


## Related

- [npm-name-cli](https://github.com/sindresorhus/npm-name-cli) - CLI for this module

0 comments on commit 053eb8a

Please sign in to comment.