<commit_before># node-marshal

Parse Ruby's Marshal objects into JavaScript objects and JSON.

This module could not have been built this without [this awesome blog post series](http://jakegoulding.com/blog/2013/01/15/a-little-dip-into-rubys-marshal-format/).

## Installation

`npm install marshal`

## Use

### Basic use

```javascript
var Marshal = require('marshal');
var m = new Marshal('0408220a68656c6c6f', 'hex');
console.log(m.parsed); // 'hello'
```

### Decode a Rails cookie

This library was purpose-built for sharing a Rails cookie with an Express session.

```javascript
//TODO
```

## Features / Limitations

### Supported

 * `nil` (converted to `null`)
 * booleans
 * integers (up to 32bit, bigints are not supported)
 * raw strings
 * symbols
 * symbol links
 * object links
 * IVARs (encoded strings, regular expressions are not supported)
 * arrays
 * objects
 * hashes

### Not supported

 * bigints
 * floats
 * classes
 * modules
 * regular expressions
 * others (see the [Ruby Marshal spec](https://github.com/rubyspec/rubyspec/tree/master/core/marshal))

## Notes

From what I can tell, positive integers are unsigned and negative integers are signed.
Thus, positive integers have twice the range as negative integers.<commit_msg>Updated RubySpec Marshal spec URL.<commit_after># node-marshal

Parse Ruby's Marshal objects into JavaScript objects and JSON.

This module could not have been built this without [this awesome blog post series](http://jakegoulding.com/blog/2013/01/15/a-little-dip-into-rubys-marshal-format/).

## Installation

`npm install marshal`

## Use

### Basic use

```javascript
var Marshal = require('marshal');
var m = new Marshal('0408220a68656c6c6f', 'hex');
console.log(m.parsed); // 'hello'
```

### Decode a Rails cookie

This library was purpose-built for sharing a Rails cookie with an Express session.

```javascript
//TODO
```

## Features / Limitations

### Supported

 * `nil` (converted to `null`)
 * booleans
 * integers (up to 32bit, bigints are not supported)
 * raw strings
 * symbols
 * symbol links
 * object links
 * IVARs (encoded strings, regular expressions are not supported)
 * arrays
 * objects
 * hashes

### Not supported

 * bigints
 * floats
 * classes
 * modules
 * regular expressions
 * others (see the [RubySpec Marshal spec](https://github.com/rubyspec/rubyspec/blob/archive/core/marshal))

## Notes

From what I can tell, positive integers are unsigned and negative integers are signed.
Thus, positive integers have twice the range as negative integers.
{'fraction_non_alphanumeric': 0.1107171000788022, 'fraction_numerical': 0.018912529550827423, 'mean_word_length': 4.289583333333334, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4565024', 'n_tokens_mistral': 806, 'n_tokens_neox': 723, 'n_words': 273}