JSPM

@u4/stringify-object

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q42815F

Stringify an object/array like JSON.stringify just without all the double-quotes, Typescript, Zero-dependency.

Package Exports

  • @u4/stringify-object

Readme

@u4/stringify-object

A zero-dependency, TypeScript-first fork of stringify-object@6.0.0. The implementation is copied locally (no runtime deps) while preserving the original behavior: handles objects, arrays, Maps/Sets, Dates, Symbols, circular references, and supports transform, filter, indent, singleQuotes, and inlineCharacterLimit options.

Install

npm install @u4/stringify-object

Usage

import stringifyObject from '@u4/stringify-object';

const input = {foo: 'bar', baz: [1, 2, 3]};
console.log(stringifyObject(input));
// {
//   foo: 'bar',
//   baz: [
//     1,
//     2,
//     3
//   ]
// }

With options:

stringifyObject(new Map([['x', 1]]), {singleQuotes: false, indent: '  '});
// new Map([
//   ["x", 1]
// ])

Scripts

  • bun run build — emit dist/index.js and dist/index.d.ts for publishing.
  • bun test — run the test suite.