Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b164150
commit 587449f
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/// <reference path="ini.d.ts" /> | ||
/// <reference path="../node/node.d.ts" /> | ||
|
||
import fs = require("fs"); | ||
import ini = require("ini"); | ||
|
||
var ini_content = fs.readFileSync("path_to_file.ini", "utf-8"); | ||
|
||
var ini_object: any = ini.decode(ini_content); | ||
var ini_rev_string: string = ini.encode(ini_object); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Type definitions for ini v1.3.3 | ||
// Project: https://github.com/isaacs/ini | ||
// Definitions by: Marcin Porębski <https://github.com/marcinporebski> | ||
// Definitions: https://github.com/borisyankov/DefinitelyTyped | ||
|
||
declare module "ini" | ||
{ | ||
interface EncodeOptions { | ||
section: string | ||
whitespace: boolean | ||
} | ||
|
||
function decode(inistring: string): any; | ||
|
||
function parse(initstring: string): any; | ||
|
||
function encode(object: any, options?: EncodeOptions): string; | ||
|
||
function stringify(object: any, options?: EncodeOptions): string; | ||
|
||
function safe(val: string): string; | ||
|
||
function unsafe(val: string): string; | ||
|
||
} |