Socket
Socket
Sign inDemoInstall

@stdlib/utils-constructor-name

Package Overview
Dependencies
Maintainers
4
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stdlib/utils-constructor-name

Determine the name of a value's constructor.


Version published
Maintainers
4
Created

What is @stdlib/utils-constructor-name?

@stdlib/utils-constructor-name is a utility package that provides a function to get the name of a constructor for a given value. This can be useful for type checking, debugging, and logging purposes.

What are @stdlib/utils-constructor-name's main functionalities?

Get Constructor Name

This feature allows you to get the name of the constructor for various types of values, including primitives, arrays, objects, and special values like null and undefined.

const constructorName = require('@stdlib/utils-constructor-name');

console.log(constructorName(5)); // 'Number'
console.log(constructorName('hello')); // 'String'
console.log(constructorName([])); // 'Array'
console.log(constructorName({})); // 'Object'
console.log(constructorName(null)); // 'null'
console.log(constructorName(undefined)); // 'undefined'

Other packages similar to @stdlib/utils-constructor-name

Keywords

FAQs

Package last updated on 27 Jul 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc