Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pg-int8

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pg-int8

64-bit big-endian signed integer-to-string conversion

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.2M
decreased by-2.83%
Maintainers
1
Weekly downloads
 
Created

What is pg-int8?

The pg-int8 npm package is designed to handle 64-bit integers (int8) in PostgreSQL. It provides functionality to parse and serialize 64-bit integers, which are not natively supported in JavaScript due to its limitation of 53-bit integer precision.

What are pg-int8's main functionalities?

Parsing 64-bit Integers

This feature allows you to parse a string representation of a 64-bit integer into a BigInt in JavaScript. This is useful when dealing with PostgreSQL int8 values.

const pgInt8 = require('pg-int8');
const parsedValue = pgInt8.parse('9223372036854775807');
console.log(parsedValue); // 9223372036854775807n

Serializing 64-bit Integers

This feature allows you to serialize a BigInt in JavaScript back into a string representation of a 64-bit integer. This is useful when you need to store or transmit int8 values to PostgreSQL.

const pgInt8 = require('pg-int8');
const serializedValue = pgInt8.serialize(9223372036854775807n);
console.log(serializedValue); // '9223372036854775807'

Other packages similar to pg-int8

FAQs

Package last updated on 14 Nov 2017

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