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.
Cartesian 3D data type, with basic vector math methods
point3d is published as an NPM module. To install it in your project, simply execute the following:
npm install --save point3d
point3d exports a single class. The class constructor can be used to construct Cartesian points at specified coordinates, as follows:
import { Point3d } from "point3d";
const point = new Point3d({ x: 1.0, y: 1.0, z: 1.0 });
The constructed Point has attached methods to perform basic vector math,
such as equality checks, addition, subtraction, and scalar and vector products.
The methods are written in a pseudo-functional style, always returning the
result rather than modifying an existing object. This allows for a concise,
chainable syntax. For example, to compute the linear sum a * x + b = c
,
you can simply chain as follows:
const c = x.scale(a).plus(b);
See the class documentation for more details.
point3d was written in a single 3-hour sprint. Development began with a 30-minute strategizing session, during which the following key decisions were made:
Actual coding took about 1.5 hours. Another half hour was needed to learn jasmine, and another half hour to learn JSDoc and write the README.
Feedback and pull requests are welcome! If you want to try modifying the code, fork the repository on GitHub.
To make sure we don't break anything as we change the code, point3d has a test suite (implemented in jasmine), which you can run as follows:
npm run test
Please be sure to update the comments in the code. Comments should follow the JSDoc syntax. When you are done, rebuild the docs before committing your code. This can be done via one of the NPM scripts, as follows:
npm run build-docs
FAQs
Cartesian 3D data type, with basic vector math methods
We found that point3d 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.