This package will repeat the selected text N times, and also may generate Fake Data if you wish using the awesome external library Faker
CTRL+SHIFT+P
to access to the command pallete and select Fake: it!
.
Behind the escenes, this package calls Faker methods in short hand (without the need to write the class name faker.
)
-
Enclose the data to fake with
{{
and}}
with the proper name of the function to call. See examples. -
Select the text (The package is capable to handle multiple selections)
-
Done!
Download or clone the contents of this repository to a folder named exactly as the package name into the Packages/ folder of ST.
-
Write, or copy and paste the following in a new ST tab/view:
-
{ "{{index()}}": "{{name()}}", }
-
Then select the inner portion marked as code:
-
{
"{{index()}}": "{{name()}}",
} -
CTRL+SHIFT+P
-
Type: Fake: It!
-
Repeat: 3
-
Press Enter
-
This is the current output:
-
{
"1": "Trina Friesen","2": "Mack Koch","3": "Burney O'Kon",
}
-
index()
# will keep an internal autoincrement counter [this is not provided by faker]- You may wish to keep aditionals autoincrement counters. You can keep separated counters by providing an argument as index such
index(1)
orindex('goals')
- You may wish to keep aditionals autoincrement counters. You can keep separated counters by providing an argument as index such
-
Supports three basic modifiers:
repeat
,encode
andescape
.-
For example
- "{{index()|repeat(3)}}"
-
Will run the faker function three times and produce
- "1,2,3"
-
For example
- "{{index()|repeat(3, '-')}}"
-
Will produce
- "1-2-3"
-
For example
- "{{url()|encode()}}"
-
Will produce
- "http%3A%2F%2Fcarroll.biz%2F"
-
For example
- "{{name()|escape()}}"
-
Will produce
- Dalibor Ma\u0161ek # for Dalibor Mašek
-
Handy List of Faker Methods (see complete list in Faker documentation)
name() # Dalibor Mašek
first_name() # Vendula
last_name() # Dušková
safe_email() # ikucera@example.net
date_time_this_year() # 2013-07-12 12:07:09
url() # http://www.duskova.cz/
uri_path(deep=None) # app/categories/category
ipv4() # 97.154.116.193
random_int(min=0, max=9999) # 5018
boolean(chance_of_getting_true=50) # True
words(nb=3) # ducimus ex rerum
sentence(nb_words=6, variable_nb_words=True) # Et eos et adipisci sed suscipit maiores.
md5(raw_output=False) # 22b9f5010ee6434c5672af4f223f9c4e
random_element(array=('a', 'b', 'b')) # b
random_letter() # i
sentence(nb_words=6, variable_nb_words=True) # Et eos et adipisci sed suscipit maiores.
sentences(nb=3) # Quis tempora nisi necessitatibus libero ipsum fugit eos ......
text(max_nb_chars=200) # Iusto deserunt rerum nostrum quia doloremque. Rem ...
word() # ut
words(nb=3) # ducimus ex rerum
paragraphs(nb=3) # Molestiae quae et placeat illum perferendis........
paragraph(nb_sentences=3, variable_nb_sentences=True) # Voluptate tenetur qui ......
year() # 2009
month() # 06
day_of_month() # 23
month_name() # February
day_of_week() # Wednesday
timezone() # Asia/Yerevan
date(pattern="%Y-%m-%d") # 1995-12-23
time(pattern="%H:%M:%S") # 10:37:21
date_time() # 1989-11-02 09:28:43
date_time_this_decade() # 2014-01-16 12:06:02
date_time_this_year() # 2013-07-12 12:07:09
date_time_this_month() # 2014-03-07 20:03:09
iso8601() # 1993-12-04T02:47:48
am_pm() # AM
unix_time() # 1351615176
name() # Dalibor Mašek
first_name() # Vendula
last_name() # Dušková
user_name() # zuzana.polakova
safe_email() # ikucera@example.net
email() # marketa06@seznam.cz
phone_number() # 733 971 899
job() # Physiological scientist
company() # Pospíšil o.s.
company_suffix() # a.s.
credit_card_number(card_type=None, validate=False, max_check=10) # 4486550681899265
address() # Za Křížem 71 191 02 Letovice
street_name() # Poslední
street_address() # Na Lázeňce 4/9
postcode() # 417 77
locale() # en_WS
country() # Samoa
country_code() # BN
language_code() # pt
city_name() # Bohušovice nad Ohří
city() # Spálené Poříčí
state() # Jihočeský kraj
latitude() # -68.8597715
longitude() # 56.371770
url() # http://www.duskova.cz/
uri() # http://zeman.cz/
domain_name() # horakova.cz
tld() # com
uri_path(deep=None) # app/categories/category
uri_page() # main
ipv4() # 97.154.116.193
ipv6() # 37cc:ff29:d8ee:bda4:24cb:76fc:7c7e:a130
user_agent() # Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 5.0; Trident/5.0)
rgb_css_color() # rgb(241,137,244)
hex_color() # #f2e171
random_int(min=0, max=9999) # 5018
random_digit() # 8
random_number(digits=None) # 610456427
numerify(text="###") # 607
password(length=10, special_chars=True, digits=True, upper_case=True, lower_case=True) # BAgRm)CTXJ
md5(raw_output=False) # 22b9f5010ee6434c5672af4f223f9c4e
sha1(raw_output=False) # c58d17a41060bbf38b5ce501c721d7114205c095
sha256(raw_output=False) # a2ce2b5a7288467d158880c113a04aa95b6e441173c6e4d4ac08a616bd4195ff
null_boolean() # None
[1] http://www.sublimetext.com/
[2] https://sublime.wbond.net/installation