2016-10-10 18 views
1

작동하지 않습니다. 나는 항상 모두 정의되지 않은을 가지고이Faker.js 생성 임의의 경로는 임의의 데이터</em>를 생성 내가 <em>에 <strong><em>faker.js</em></strong> <a href="https://www.npmjs.com/package/faker" rel="nofollow">https://www.npmjs.com/package/faker</a> 을 사용하고

faker.system.directoryPath() + '/' + faker.system.filePath() 

같은 경로를 만들려고 할 때 비록 존재하지만 아무것도 반환하지 않는 것 같다, 그래서 그것은 잘 작동합니다.

누구나 이전에이 방법 중 하나를 사용 했습니까?

미리 감사드립니다. 도움을 주시면 감사하겠습니다.

그 기능이 구현되지 않은

답변

1

안녕 - https://github.com/Marak/faker.js/blob/master/lib/system.js#L132https://github.com/Marak/faker.js/blob/master/lib/system.js#L141

/** 
    * not yet implemented 
    * 
    * @method faker.system.filePath 
    */ 
    this.filePath = function() { 
    // TODO 
    }; 

으로 개념의 일부 증거를 살펴이 구현 될 수있는 방법은 :

var faker = require('faker'); 
var path = require('path'); 

faker.directoryPath = function() { 
    return path.format({base: faker.fake("{{random.words}}").replace(/ /g, path.sep).toLowerCase()}) 
} 

console.log(faker.directoryPath() + path.sep + faker.system.fileName()) // e.g. avon\re-engineered\strategist_gorgeous_wooden_fish_cambridgeshire.sm 
+0

난 그냥 보았다. .. :(많은 thx – ackuser