Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-name-taken

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-name-taken - npm Package Compare versions

Comparing version 1.1.1 to 2.0.0

3

build/index.d.ts

@@ -1,2 +0,3 @@

export declare type Options = {
import { LoadOptions } from "all-package-names";
export declare type Options = LoadOptions & {
/**

@@ -3,0 +4,0 @@ * Setting optimistic to true will skip syncing latest packages from NPM.

@@ -23,2 +23,10 @@ "use strict";

function getSave(options) {
if (options != null && options.optimistic) {
return (0, _allPackageNames.load)(options);
} else {
return (0, _allPackageNames.sync)(options);
}
}
function isTaken(_x, _x2) {

@@ -31,3 +39,3 @@ return _isTaken.apply(this, arguments);

if (isValid(name)) {
return (options != null && options.optimistic ? _allPackageNames.load : _allPackageNames.sync)().then(function (_ref) {
return getSave(options).then(function (_ref) {
var packageNames = _ref.packageNames;

@@ -34,0 +42,0 @@ return (0, _packageNameConflict.conflictsAny)(name, packageNames);

@@ -0,1 +1,15 @@

# [2.0.0](https://github.com/bconnorwhite/is-name-taken/compare/v1.1.1...v2.0.0) (2021-04-08)
### Features
* add maxAge flag, improve caching ([9c4058a](https://github.com/bconnorwhite/is-name-taken/commit/9c4058ac3868ea53f08a3846e448b731ae747b08))
### BREAKING CHANGES
* replaced timeout flag with maxAge
## [1.1.1](https://github.com/bconnorwhite/is-name-taken/compare/v1.1.0...v1.1.1) (2021-04-05)

@@ -2,0 +16,0 @@

{
"name": "is-name-taken",
"version": "1.1.1",
"version": "2.0.0",
"description": "Check if an NPM package name is taken",

@@ -38,4 +38,2 @@ "license": "MIT",

"lint": "bob lint",
"postversion": "git push",
"prepublishOnly": "yarn build && yarn test",
"release": "bob publish",

@@ -45,4 +43,4 @@ "test": "bob test"

"dependencies": {
"all-package-names": "^1.0.17",
"package-name-conflict": "^1.0.1",
"all-package-names": "^2.0.2",
"package-name-conflict": "^1.0.3",
"validate-npm-package-name": "^3.0.0"

@@ -57,2 +55,7 @@ },

},
"husky": {
"hooks": {
"commit-msg": "bob lint commit"
}
},
"npmpackagejsonlint": {

@@ -59,0 +62,0 @@ "extends": "npm-package-json-lint-config-bob"

@@ -64,13 +64,17 @@ <div align="center">

isTaken(name: string, options?: Options) => Promise<boolean | string>;
isValid(name: string) => boolean;
type Options = {
/**
* Maximum milliseconds after a sync to avoid re-syncing
*/
maxAge?: number;
/**
* Setting optimistic to true will skip syncing latest packages from NPM.
* This is faster, but may lead to inconsistencies with recently published packages.
*/
*/
optimistic?: boolean;
};
function isValid(name: string): boolean;
function isTaken(name: string, options?: Options): Promise<string | boolean>;
```

@@ -84,3 +88,3 @@

- [all-package-names](https://npmjs.com/package/all-package-names): Get all NPM package names.
- [all-package-names](https://npmjs.com/package/all-package-names): Get all NPM package names
- [package-name-conflict](https://npmjs.com/package/package-name-conflict): Check if NPM package names conflict

@@ -87,0 +91,0 @@ - [validate-npm-package-name](https://npmjs.com/package/validate-npm-package-name): Give me a string and I'll tell you if it's a valid npm package name

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc