Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
redux-create-action-index
Advanced tools
Creates an ES6 ./index.js file within target directories that imports all action files and exports a single action object.
CLI utility to creates or update a index.js file in supplied target directories. The generated index file will import all sibling redux action files and export a single redux action object.
npm install --save-dev redux-create-action-index
redux-create-action-index ./src/actions
Given the following directory structure:
> tree ./src/actions
./
├── file1.js
├── file2.js
├── file3.js
├── file4.js
└── file5.js
0 directories, 5 files
Running js redux-create-action-index ./src/actions
will generate an index.js
file in ./src/actions
containing:
import * as file1Actions from './file1.js';
import * as file2Actions from './file2.js';
import * as file3Actions from './file3.js';
import * as file4Actions from './file4.js';
import * as file5Actions from './file5.js';
export default Object.assign({},
file1Actions,
file2Actions,
file3Actions,
file4Actions,
file5Actions
);
These ActionCreators can now be accessed in any component using redux's connect via:
import {connect} from 'react-redux';
import ActionCreators from '../actions';
...
function mapDispatchToProps(dispatch) {
return bindActionCreators(ActionCreators, dispatch);
}
...
export default connect(mapStateToProps, mapDispatchToProps)(Component);
--indent, -i set number of spaces to indent [number] [default: 4]
--suffix, -s suffix to add to the import module name [string] [default: "Actions"]
--help Show help [boolean]
FAQs
Creates an ES6 ./index.js file within target directories that imports all action files and exports a single action object.
We found that redux-create-action-index 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.