Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
StringScanner is a simple string tokenizer that provides for lexical scanning operations on a string. It's a JavaScript port of the Ruby library with the same name.
Scanning a string means keeping track of and advancing a position (a zero-based index into the source string) and matching regular expressions against the portion of the source string after the position.
StringScanner is written in CoffeeScript and distributed via npm as a CommonJS module.
$ npm install strscan
$ node-repl
> var StringScanner = require("strscan").StringScanner
> var s = new StringScanner("This is a test")
> s.scan(/\w+/) # => "This"
> s.scan(/\w+/) # => null
> s.scan(/\s+/) # => " "
> s.scan(/\s+/) # => null
> s.scan(/\w+/) # => "is"
> s.hasTerminated() # => false
> s.scan(/\s+/) # => " "
> s.scan(/(\w+)\s+(\w+)/) # => "a test"
> s.getMatch() # => "a test"
> s.getCapture(0) # => "a"
> s.getCapture(1) # => "test"
> s.hasTerminated() # => true
Clone, fork, or file bugs at GitHub
Read the full documentation/annotated source code
Copyright (c) 2010 Sam Stephenson. Distributed under the terms of an MIT-style license. See LICENSE for details.
FAQs
Simple string tokenizer for lexical scanning operations
The npm package strscan receives a total of 1,705 weekly downloads. As such, strscan popularity was classified as popular.
We found that strscan demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.