
Research
Shai-Hulud Descends to Hades: Miasma Worm Campaign Spreads with New PyPI Wave
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.
@stdlib/array-dtype
Advanced tools
Return the data type of an array.
npm install @stdlib/array-dtype
var dtype = require( '@stdlib/array-dtype' );
Returns the data type of an array.
var Float64Array = require( '@stdlib/array-float64' );
var arr = new Float64Array( 10 );
var dt = dtype( arr );
// returns 'float64'
If provided an argument having an unknown or unsupported data type, the function returns null.
var dt = dtype( 'beep' );
// returns null
var dtypes = require( '@stdlib/array-dtypes' );
var ctors = require( '@stdlib/array-ctors' );
var dtype = require( '@stdlib/array-dtype' );
var DTYPES;
var ctor;
var arr;
var len;
var dt;
var i;
// Get a list of supported array data types:
DTYPES = dtypes();
// Array length:
len = 10;
// For each supported data type, create an array and confirm its data type...
for ( i = 0; i < DTYPES.length; i++ ) {
ctor = ctors( DTYPES[ i ] );
arr = new ctor( len );
dt = dtype( arr );
console.log( '%s == %s => %s', DTYPES[ i ], dt, DTYPES[ i ] === dt );
}
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
See LICENSE.
Copyright © 2016-2021. The Stdlib Authors.
FAQs
Return the data type of an array.
The npm package @stdlib/array-dtype receives a total of 25,305 weekly downloads. As such, @stdlib/array-dtype popularity was classified as popular.
We found that @stdlib/array-dtype 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
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.

Security News
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.