
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A react component that renders an input field. When hitting enter or entering a comma, the value will be used to create a tag. Tags are displayed in front of the input.
Install as node dependency:
npm install tag-input --save
To test locally change to node_modules/tag-input and run:
npm start & npm run watch
npm run build - build production css and jsnpm run watch - compile css and jsnpm run watch:test - run tests on changenpm start - start static dev servernpm test - run lint and testsThe userInput and tags states have been removed in order to make it the componetn reusable in situations where it was used as a child component.
In order to make use of this component a parent component is required. The parent component manages the userInput and tags state. It listens to changes and re-renderers the tag-inputcomponent. Have a look at the following example:
'use strict';
var React = require('react');
var tagInputComponent = require('../');
var tagInputContainer = React.createClass({
getInitialState: function () {
return {
userInput: '',
tags: []
};
},
render: function () {
var self = this;
return (
React.DOM.div(null, React.createElement(tagInputComponent, {
userInput: self.state.userInput,
tags: self.state.tags,
onInputChange: function (input) {
self.setState({ userInput: input });
},
onTagChange: function (tags) {
self.setState({ tags: tags });
// save the tags here
}
}))
);
}
});
React.render(React.createElement(tagInputContainer),
document.querySelector('#content'));
var React = require('react');
var tagInput = require('tag-input');
React.render(React.createElement(tagInput),
document.querySelector('#content'));
onInputChange: called whenever the input value is changed.onTagChange: called when a tag is added or removed. Called with tags array.minTagLength: Set the minimum character length of a tag. Default is 3.cssClass: optional css class for containertags: array of strings that represent the tagsuserInput: the value of the inputMIT
FAQs
Input that converts comma separated words to tags
We found that tag-input 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.