Skip to content

Commit

Permalink
version 1
Browse files Browse the repository at this point in the history
  • Loading branch information
matgr1 committed Oct 19, 2016
1 parent c5b1acf commit a9be1da
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 18 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# read-text-file

NOTE: es5 version requires babel-polyfill
handles and strips byte order marks when reading a text file

```bash
npm install read-text-file --save
```

```javascript
var readTextFile = require('read-text-file');

var contentsPromise = readTextFile.read('path/to/file.txt');
var contents = readTextFile.readSync('path/to/file.txt');
```
10 changes: 5 additions & 5 deletions build/es5/read-text-file.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions build/es6/read-text-file.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/read-text-file.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export declare function readTextFile(path: string): Promise<string>;
export declare function readTextFileSync(path: string): string;
export declare function read(path: string): Promise<string>;
export declare function readSync(path: string): string;
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "read-text-file",
"version": "0.0.0-alpha.3",
"description": "handles and strips byte order marks when reading a text file",
"version": "1.0.0",
"keywords": [
"textfile",
"text",
"file"
"file",
"bom",
"byte order mark"
],
"author": "matgr1",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions src/read-text-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as path from "path";

import { StringDecoder } from "string_decoder";

export async function readTextFile(path: string): Promise<string>
export async function read(path: string): Promise<string>
{
let stat = await fileStat(path);

Expand Down Expand Up @@ -40,7 +40,7 @@ export async function readTextFile(path: string): Promise<string>
return result;
}

export function readTextFileSync(path: string): string
export function readSync(path: string): string
{
let stat = fs.statSync(path);

Expand Down

0 comments on commit a9be1da

Please sign in to comment.