
Research
Namastex.ai npm Packages Hit with TeamPCP-Style CanisterWorm Malware
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.
@im-open/react-text-mask
Advanced tools
First, install it.
npm i react-text-mask --save
Then, require it and use it.
import React from "react";
import MaskedInput from "react-text-mask";
export default () => (
<div>
<MaskedInput
mask={[
"(",
/[1-9]/,
/\d/,
/\d/,
")",
" ",
/\d/,
/\d/,
/\d/,
"-",
/\d/,
/\d/,
/\d/,
/\d/,
]}
/>
</div>
);
<MaskedInput/> is fully compatible with <input/> element. So, you can
pass it CSS classes, a placeholder attribute, or even an onBlur handler.
For example, the following works:
<MaskedInput
mask={[
"(",
/[1-9]/,
/\d/,
/\d/,
")",
" ",
/\d/,
/\d/,
/\d/,
"-",
/\d/,
/\d/,
/\d/,
/\d/,
]}
className="form-control"
placeholder="Enter a phone number"
guide={false}
id="my-input-id"
onBlur={() => {}}
onChange={() => {}}
/>
For more information about the props that you can pass to the component, see
the documentation here.
To see an example of the code running, follow these steps:
git clone git@github.com:im-open/text-mask.gitcd text-masknpm installnpm run react:devThe code of the example is in react/example.
<input> ComponentFor advanced uses, you can customize the rendering of the resultant <input> via a render prop.
This is entirely optional, if no render prop is passed, a normal <input> is rendered.
For example, to use with styled-components, which requires an innerRef:
<MaskedInput
mask={[
"(",
/[1-9]/,
/\d/,
/\d/,
")",
" ",
/\d/,
/\d/,
/\d/,
"-",
/\d/,
/\d/,
/\d/,
/\d/,
]}
placeholder="Enter a phone number"
id="my-input-id"
render={(ref, props) => <MyStyledInput innerRef={ref} {...props} />}
/>;
const MyStyledInput = styled.input`
background: papayawhip;
`;
We would love some contributions! Check out this document to get started.
FAQs
React input component that accepts mask pattern
The npm package @im-open/react-text-mask receives a total of 343 weekly downloads. As such, @im-open/react-text-mask popularity was classified as not popular.
We found that @im-open/react-text-mask demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.