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.
The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects.
@nx/js is a package that provides tools and utilities for managing JavaScript projects within the Nx workspace. It offers functionalities for building, testing, and managing dependencies in JavaScript projects.
Building JavaScript Projects
This feature allows you to build JavaScript projects using the Nx build executor. The code sample demonstrates how to configure a project named 'myApp' with build options.
module.exports = {
projects: {
myApp: {
root: 'apps/my-app',
sourceRoot: 'apps/my-app/src',
projectType: 'application',
targets: {
build: {
executor: '@nx/js:build',
options: {
outputPath: 'dist/apps/my-app',
main: 'apps/my-app/src/main.ts',
tsConfig: 'apps/my-app/tsconfig.app.json'
}
}
}
}
}
};
Testing JavaScript Projects
This feature allows you to test JavaScript projects using the Nx test executor. The code sample demonstrates how to configure a project named 'myApp' with test options.
module.exports = {
projects: {
myApp: {
root: 'apps/my-app',
sourceRoot: 'apps/my-app/src',
projectType: 'application',
targets: {
test: {
executor: '@nx/js:test',
options: {
jestConfig: 'apps/my-app/jest.config.js',
passWithNoTests: true
}
}
}
}
}
};
Managing Dependencies
This feature allows you to manage dependencies and lint JavaScript projects using the Nx lint executor. The code sample demonstrates how to configure a project named 'myApp' with lint options.
module.exports = {
projects: {
myApp: {
root: 'apps/my-app',
sourceRoot: 'apps/my-app/src',
projectType: 'application',
targets: {
lint: {
executor: '@nx/js:lint',
options: {
lintFilePatterns: ['apps/my-app/**/*.ts']
}
}
}
}
}
};
Webpack is a popular module bundler for JavaScript applications. It allows you to bundle JavaScript files for usage in a browser and offers a wide range of plugins and loaders. Compared to @nx/js, Webpack is more focused on the bundling aspect and does not provide the same level of project management and dependency management features.
Jest is a delightful JavaScript testing framework with a focus on simplicity. It works with projects using Babel, TypeScript, Node.js, React, Angular, Vue.js, and Svelte. Compared to @nx/js, Jest is specifically focused on testing and does not provide build or dependency management features.
ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. It helps in maintaining code quality and consistency. Compared to @nx/js, ESLint is specifically focused on linting and does not provide build or testing features.
Nx is a build system, optimized for monorepos, with plugins for popular frameworks and tools and advanced CI capabilities including caching and distribution.
This package is a JavaScript/TypeScript plugin for Nx.
Using npx
npx create-nx-workspace
Using npm init
npm init nx-workspace
Using yarn create
yarn create nx-workspace
Run:
npx nx@latest init
FAQs
The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects.
We found that @nx/js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 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.