0.0.5 • Published 4 years ago

node-perl-storable v0.0.5

Weekly downloads
11
License
BSD-2-Clause
Repository
github
Last release
4 years ago

NAME

node-perl-storable - � packer-unpacker for format from perl world: https://metacpan.org/pod/Storable

VERSION

0.0.5

DESCRIPTION

class A {
    constructor() {
	    throw new Error("Create objects without constructor!");
    }

    getX() {
	    return this.x;
    }
}

let exec = require('child_process').execSync;

let stdout = exec("perl -MStorable -e 'print Storable::freeze(bless {x=>123}, A)'");

let a = require("node-perl-storable").thaw(stdout, {A});

console.log(a instanceof A, a.getX()); // --> true, 123
const Iconv = require('iconv').Iconv;
const iconv_to_cp1251 = new Iconv('utf8', 'windows-1251');
const iconv_from_cp1251 = new Iconv('windows-1251', 'utf8');

let stdout = require('child_process').execSync(
    iconv_to_cp1251.convert(
        "perl -MStorable -e 'print Storable::freeze(\"������!\")'"));

let hello = require("node-perl-storable").thaw(stdout, {}, {
    iconv: buffer => iconv_from_cp1251.convert(buffer).toString(),
});

console.log(hello); // --> "������!"

SYNOPSIS

� ����� perl ���� ���� ������ �������� ������ ��� �������� ����� ��������: �����, �������, ��������, ���������, ��������, �������� ������������, ������, ������ � �.�. �� ����������� ������� https://metacpan.org/pod/Storable.

������ ������ �������� ��������� � ������������ � �������� ������ ������ ��������� �������� �� perl �������� �� ������� ����������: mysql, memcached, tarantool � �.�.

������ ������� ������ ������������ ��� ���������� ������, ���������� �� ����� ��������, � ��������� node.

FUNCTIONS

thaw

ARGUMENTS

  • storable - �������� ������
  • classes - ������� � ��������. �������������� ��������
  • options.iconv - ������� ��� ����������� ����� �� � utf8. �������������� ��������

RETURNS

Any

INSTALL

$ yarn add node-perl-storable

���

$ npm i node-perl-storable

REQUIREMENTS

���

LICENSE

Copyright (C) Yaroslav O. Kosmina.

This library is free software; you can redistribute it and/or modify it under the same terms as Python itself.

AUTHOR

Yaroslav O. Kosmina darviarush@mail.ru

LICENSE

MIT License

Copyright (c) 2020 Yaroslav O. Kosmina

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago