
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
github-username-regex
Advanced tools
A regular expression that only matches a valid Github username
import githubUsernameRegex from 'github-username-regex';
githubUsernameRegex.test('john'); //=> true
githubUsernameRegex.test('john-due'); //=> true
githubUsernameRegex.test('john-due-'); //=> false
According to the form validation messages on Join Github page,
npm install github-username-regex
bower install github-username-regex
import githubUsernameRegex from 'github-username-regex';
Type: RegExp (/^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}$/i)
// Returns `true`
githubUsernameRegex.test('a');
githubUsernameRegex.test('0');
githubUsernameRegex.test('a-b');
githubUsernameRegex.test('a-b-123');
githubUsernameRegex.test('a'.repeat(39));
// Returns `false`
githubUsernameRegex.test('');
githubUsernameRegex.test('a_b');
githubUsernameRegex.test('a--b');
githubUsernameRegex.test('a-b-');
githubUsernameRegex.test('-a-b');
githubUsernameRegex.test('a'.repeat(40));
Note that this module doesn't take reserved usernames into consideration. For example it matches help, about and pricing, though they are reserved words and cannot be used as Github usernames.
FAQs
A regular expression that only matches a valid Github username
The npm package github-username-regex receives a total of 4,625 weekly downloads. As such, github-username-regex popularity was classified as popular.
We found that github-username-regex demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.