NetSuite data import with country code? - netsuite

Question for the NetSuite experts:
Before my time, my current company decided to move to NetSuite. I'm being asked to retrieve customer data from our in-house SaaS and reformat it for import to NetSuite. Our NetSuite consultant says the customer import feature requires us to specify country by country name -- and, of course, NetSuite's built-in list of country names differs from our internal list which some developer pulled long ago from ISO 3166.
We asked the consultant why NetSuite doesn't import based upon two-letter ISO 3166 country code. He shrugged.
So, NetSuite experts, why doesn't Oracle allow for importing of customer data with two-letter ISO 3166 country code?

That's how system Architectured.
The only way is to use country enumerations table for lookup and replace codes with country names.
Ref: https://netsuite.custhelp.com/app/answers/detail/a_id/10888

For those of you who are hit by a password wall:
COUNTRY_MAPPINGS = {
"Afghanistan": "AF",
"Aland Islands": "AX",
"Albania": "AL",
"Algeria": "DZ",
"American Samoa": "AS",
"Andorra": "AD",
"Angola": "AO",
"Anguilla": "AI",
"Antarctica": "AQ",
"Antigua and Barbuda": "AG",
"Argentina": "AR",
"Armenia": "AM",
"Aruba": "AW",
"Australia": "AU",
"Austria": "AT",
"Azerbaijan": "AZ",
"Bahamas": "BS",
"Bahrain": "BH",
"Bangladesh": "BD",
"Barbados": "BB",
"Belarus": "BY",
"Belgium": "BE",
"Belize": "BZ",
"Benin": "BJ",
"Bermuda": "BM",
"Bhutan": "BT",
"Bolivia": "BO",
"Bonaire, Saint Eustatius, and Saba": "BQ",
"Bosnia and Herzegovina": "BA",
"Botswana": "BW",
"Bouvet Island": "BV",
"Brazil": "BR",
"British Indian Ocean Territory": "IO",
"Brunei Darussalam": "BN",
"Bulgaria": "BG",
"Burkina Faso": "BF",
"Burundi": "BI",
"Cambodia": "KH",
"Cameroon": "CM",
"Canada": "CA",
"Canary Islands": "IC",
"Cape Verde": "CV",
"Cayman Islands": "KY",
"Central African Republic": "CF",
"Ceuta and Melilla": "EA",
"Chad": "TD",
"Chile": "CL",
"China": "CN",
"Christmas Island": "CX",
"Cocos (Keeling) Islands": "CC",
"Colombia": "CO",
"Comoros": "KM",
"Congo, Democratic People's Republic": "CD",
"Congo, Republic of": "CG",
"Cook Islands": "CK",
"Costa Rica": "CR",
"Cote d'Ivoire": "CI",
"Croatia/Hrvatska": "HR",
"Cuba": "CU",
"Curacao": "CW",
"Cyprus": "CY",
"Czech Republic": "CZ",
"Denmark": "DK",
"Djibouti": "DJ",
"Dominica": "DM",
"Dominican Republic": "DO",
"East Timor": "TL",
"Ecuador": "EC",
"Egypt": "EG",
"El Salvador": "SV",
"Equatorial Guinea": "GQ",
"Eritrea": "ER",
"Estonia": "EE",
"Ethiopia": "ET",
"Falkland Islands": "FK",
"Faroe Islands": "FO",
"Fiji": "FJ",
"Finland": "FI",
"France": "FR",
"French Guiana": "GF",
"French Polynesia": "PF",
"French Southern Territories": "TF",
"Gabon": "GA",
"Gambia": "GM",
"Georgia": "GE",
"Germany": "DE",
"Ghana": "GH",
"Gibraltar": "GI",
"Greece": "GR",
"Greenland": "GL",
"Grenada": "GD",
"Guadeloupe": "GP",
"Guam": "GU",
"Guatemala": "GT",
"Guernsey": "GG",
"Guinea": "GN",
"Guinea-Bissau": "GW",
"Guyana": "GY",
"Haiti": "HT",
"Heard and McDonald Islands": "HM",
"Holy See (City Vatican State)": "VA",
"Honduras": "HN",
"Hong Kong": "HK",
"Hungary": "HU",
"Iceland": "IS",
"India": "IN",
"Indonesia": "ID",
"Iran (Islamic Republic of)": "IR",
"Iraq": "IQ",
"Ireland": "IE",
"Isle of Man": "IM",
"Israel": "IL",
"Italy": "IT",
"Jamaica": "JM",
"Japan": "JP",
"Jersey": "JE",
"Jordan": "JO",
"Kazakhstan": "KZ",
"Kenya": "KE",
"Kiribati": "KI",
"Korea, Democratic People's Republic": "KP",
"Korea, Republic of": "KR",
"Kosovo": "XK",
"Kuwait": "KW",
"Kyrgyzstan": "KG",
"Lao, People's Democratic Republic": "LA",
"Latvia": "LV",
"Lebanon": "LB",
"Lesotho": "LS",
"Liberia": "LR",
"Libya": "LY",
"Liechtenstein": "LI",
"Lithuania": "LT",
"Luxembourg": "LU",
"Macau": "MO",
"Macedonia": "MK",
"Madagascar": "MG",
"Malawi": "MW",
"Malaysia": "MY",
"Maldives": "MV",
"Mali": "ML",
"Malta": "MT",
"Marshall Islands": "MH",
"Martinique": "MQ",
"Mauritania": "MR",
"Mauritius": "MU",
"Mayotte": "YT",
"Mexico": "MX",
"Micronesia, Federal State of": "FM",
"Moldova, Republic of": "MD",
"Monaco": "MC",
"Mongolia": "MN",
"Montenegro": "ME",
"Montserrat": "MS",
"Morocco": "MA",
"Mozambique": "MZ",
"Myanmar": "MM",
"Namibia": "NA",
"Nauru": "NR",
"Nepal": "NP",
"Netherlands": "NL",
"New Caledonia": "NC",
"New Zealand": "NZ",
"Nicaragua": "NI",
"Niger": "NE",
"Nigeria": "NG",
"Niue": "NU",
"Norfolk Island": "NF",
"Northern Mariana Islands": "MP",
"Norway": "NO",
"Oman": "OM",
"Pakistan": "PK",
"Palau": "PW",
"Panama": "PA",
"Papua New Guinea": "PG",
"Paraguay": "PY",
"Peru": "PE",
"Philippines": "PH",
"Pitcairn Island": "PN",
"Poland": "PL",
"Portugal": "PT",
"Puerto Rico": "PR",
"Qatar": "QA",
"Reunion Island": "RE",
"Romania": "RO",
"Russian Federation": "RU",
"Rwanda": "RW",
"Saint Barthélemy": "BL",
"Saint Helena": "SH",
"Saint Kitts and Nevis": "KN",
"Saint Lucia": "LC",
"Saint Martin": "MF",
"Saint Vincent and the Grenadines": "VC",
"Samoa": "WS",
"San Marino": "SM",
"Sao Tome and Principe": "ST",
"Saudi Arabia": "SA",
"Senegal": "SN",
"Serbia": "RS",
"Seychelles": "SC",
"Sierra Leone": "SL",
"Singapore": "SG",
"Sint Maarten": "SX",
"Slovak Republic": "SK",
"Slovenia": "SI",
"Solomon Islands": "SB",
"Somalia": "SO",
"South Africa": "ZA",
"South Georgia": "GS",
"South Sudan": "SS",
"Spain": "ES",
"Sri Lanka": "LK",
"State of Palestine": "PS",
"St. Pierre and Miquelon": "PM",
"Sudan": "SD",
"Suriname": "SR",
"Svalbard and Jan Mayen Islands": "SJ",
"Swaziland": "SZ",
"Sweden": "SE",
"Switzerland": "CH",
"Syrian Arab Republic": "SY",
"Taiwan": "TW",
"Tajikistan": "TJ",
"Tanzania": "TZ",
"Thailand": "TH",
"Togo": "TG",
"Tokelau": "TK",
"Tonga": "TO",
"Trinidad and Tobago": "TT",
"Tunisia": "TN",
"Turkey": "TR",
"Turkmenistan": "TM",
"Turks and Caicos Islands": "TC",
"Tuvalu": "TV",
"Uganda": "UG",
"Ukraine": "UA",
"United Arab Emirates": "AE",
"United Kingdom": "GB",
"United States": "US",
"Uruguay": "UY",
"US Minor Outlying Islands": "UM",
"Uzbekistan": "UZ",
"Vanuatu": "VU",
"Venezuela": "VE",
"Vietnam": "VN",
"Virgin Islands, British": "VG",
"Virgin Islands, USA": "VI",
"Wallis and Futuna Islands": "WF",
"Western Sahara": "EH",
"Yemen": "YE",
"Zambia": "ZM",
"Zimbabwe": "ZW"
}

Related

Shell Script Assigning json object to an variable for iteration

DATA="$(curl "https://www.alphavantage.co/query?function=SYMBOL_SEARCH&keywords=BA&apikey=demo" | jq '.bestMatches' | jq '.[] | ."1. symbol"')"
I want to iterate over DATA variable which would ideally be an array. What I want to do here is two fold.
I need a way to select the "1. symbol" attribute of all the records which have a "matchScore" greater than 0.5. This is a problematic thing for me to do since the matchScore contains a string, not a number.
I want to store the selected "1. Symbol" attributes in a variable which I can iterate over later to do more operations.
{
"bestMatches": [
{
"1. symbol": "BA",
"2. name": "The Boeing Company",
"3. type": "Equity",
"4. region": "United States",
"5. marketOpen": "09:30",
"6. marketClose": "16:00",
"7. timezone": "UTC-05",
"8. currency": "USD",
"9. matchScore": "1.0000"
},
{
"1. symbol": "BAC",
"2. name": "Bank of America Corporation",
"3. type": "Equity",
"4. region": "United States",
"5. marketOpen": "09:30",
"6. marketClose": "16:00",
"7. timezone": "UTC-05",
"8. currency": "USD",
"9. matchScore": "0.8000"
},
{
"1. symbol": "BABA",
"2. name": "Alibaba Group Holding Limited",
"3. type": "Equity",
"4. region": "United States",
"5. marketOpen": "09:30",
"6. marketClose": "16:00",
"7. timezone": "UTC-05",
"8. currency": "USD",
"9. matchScore": "0.6667"
},
{
"1. symbol": "GOLD",
"2. name": "Barrick Gold Corporation",
"3. type": "Equity",
"4. region": "United States",
"5. marketOpen": "09:30",
"6. marketClose": "16:00",
"7. timezone": "UTC-05",
"8. currency": "USD",
"9. matchScore": "0.5714"
},
{
"1. symbol": "BIDU",
"2. name": "Baidu Inc.",
"3. type": "Equity",
"4. region": "United States",
"5. marketOpen": "09:30",
"6. marketClose": "16:00",
"7. timezone": "UTC-05",
"8. currency": "USD",
"9. matchScore": "0.5000"
},
{
"1. symbol": "BAYRY",
"2. name": "Bayer Aktiengesellschaft",
"3. type": "Equity",
"4. region": "United States",
"5. marketOpen": "09:30",
"6. marketClose": "16:00",
"7. timezone": "UTC-05",
"8. currency": "USD",
"9. matchScore": "0.4000"
},
{
"1. symbol": "BLDP",
"2. name": "Ballard Power Systems Inc.",
"3. type": "Equity",
"4. region": "United States",
"5. marketOpen": "09:30",
"6. marketClose": "16:00",
"7. timezone": "UTC-05",
"8. currency": "USD",
"9. matchScore": "0.3333"
},
{
"1. symbol": "BHC",
"2. name": "Bausch Health Companies Inc.",
"3. type": "Equity",
"4. region": "United States",
"5. marketOpen": "09:30",
"6. marketClose": "16:00",
"7. timezone": "UTC-05",
"8. currency": "USD",
"9. matchScore": "0.3333"
},
{
"1. symbol": "BK",
"2. name": "The Bank of New York Mellon Corporation",
"3. type": "Equity",
"4. region": "United States",
"5. marketOpen": "09:30",
"6. marketClose": "16:00",
"7. timezone": "UTC-05",
"8. currency": "USD",
"9. matchScore": "0.1538"
}
]
}
The above is the json object I get.
Convert the field value from integer to number with tonumber and so:
readarray data <<< "$(jq -r '.bestMatches[] | select(."9. matchScore" | tonumber > 0.5) | ."1. symbol"' jq)"
Redirect the output of the jq command into readarray to create an array.

How to call '[object Object] in angular *ngFor [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
myjson is :
[
{
"support": 2,
"items": [
[
{
"title": "Segitiga Wolfis",
"price": 23000,
"description": "Bahan seratus persen ori, kain kualitas premium. Cocok untuk berpergian acara dan bersantai. Dibuat dengan sepenuh hati dengan prporsisi jahit yang detail dan hasil tampilan yang unik.",
"image": "https://cf.shopee.co.id/file/a98a024dfd6e210773bce8af3e8f604d_tn"
}
]
]
},
{
"support": 1,
"items": [
[
{
"title": "Instan Hijab Triangle",
"price": 25000,
"description": "Bahan Lembut, Cocok untuk berpergian dan bersantai. Instant Hijab Triangle Veil Instant Triangle Lace Veil Amelia Lace Triangle\r\n\r\nColor: Amelia Softpink, Amelia Softpeach, Amelia Navy, Amelia Black\r\nType: instant triangle hijab\r\nMaterial: pollycatton\r\nWeight: 120 grams",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/05/025c74dc748fb1ebc76e95d7be7f85b2.jpeg"
},
{
"title": "Hijab Quadril Syar'i",
"price": 44000,
"description": "Hijab Quadril Syar'i Diamond Hijab Quadrilateral\r\n\r\nIngredients = Italiano Diamond\r\n\r\nSize = 145 x 145 cm\r\n\r\nEdges = boutique-style sewing edges\r\n\r\nWeight = 210 grams",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/06/87fcc99a88694bbdcf36841e7671a5cd.jpeg"
}
]
]
},
{
"support": 1,
"items": [
[
{
"title": "Instan Hijab Triangle",
"price": 25000,
"description": "Bahan Lembut, Cocok untuk berpergian dan bersantai. Instant Hijab Triangle Veil Instant Triangle Lace Veil Amelia Lace Triangle\r\n\r\nColor: Amelia Softpink, Amelia Softpeach, Amelia Navy, Amelia Black\r\nType: instant triangle hijab\r\nMaterial: pollycatton\r\nWeight: 120 grams",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/05/025c74dc748fb1ebc76e95d7be7f85b2.jpeg"
},
{
"title": "Pashmina Ceruti Starp",
"price": 50000,
"description": "Pashmina Ceruty strap Pasmina Babydoll Ceruty hijab pasmina strap\r\nkarakteristik bahan :\r\n- Lentur/jatuh kebawah sehingga mudah dibentuk.\r\n- Tekstur ringan, halus dan lembut. nyaman untuk dipakai sehari hari.\r\n- Tidak mudah kusut.\r\n\r\nMaterial = Babydoll ceruty\r\nSize = 175 x 75 cm\r\nEdge = neat sewing\r\n\r\nWeight = 120 grams\r\n",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/06/9b7d781d5c2c1bbb73ba7d5615b7677f.jpeg"
},
{
"title": "Satin Square",
"price": 25000,
"description": "Bahan hijab satin sangat baik dan berkualitas. Terlihat mengilap dan lembut, serta ringan saat disentuh. Ketika dikenakan hijab ini nyaman dan tak membuat rasa panas. Untuk kamu yang suka dengan tampilan berbeda, andalkan saja hijab satin ini yang cocok untuk gaya kasual hingga kondangan.",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/05/b9ec3e70e56c34c97cc578bc2f027fe2.jpeg"
}
]
]
},
{
"support": 1,
"items": [
[
{
"title": "Hijab Quadril Syar'i",
"price": 44000,
"description": "Hijab Quadril Syar'i Diamond Hijab Quadrilateral\r\n\r\nIngredients = Italiano Diamond\r\n\r\nSize = 145 x 145 cm\r\n\r\nEdges = boutique-style sewing edges\r\n\r\nWeight = 210 grams",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/06/87fcc99a88694bbdcf36841e7671a5cd.jpeg"
}
]
]
},
{
"support": 1,
"items": [
[
{
"title": "Satin Square",
"price": 25000,
"description": "Bahan hijab satin sangat baik dan berkualitas. Terlihat mengilap dan lembut, serta ringan saat disentuh. Ketika dikenakan hijab ini nyaman dan tak membuat rasa panas. Untuk kamu yang suka dengan tampilan berbeda, andalkan saja hijab satin ini yang cocok untuk gaya kasual hingga kondangan.",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/05/b9ec3e70e56c34c97cc578bc2f027fe2.jpeg"
}
]
]
},
{
"support": 2,
"items": [
[
{
"title": "Hijab Instan Diamond Lova",
"price": 50000,
"description": "Instant Hijab bergo Lova Instant Hijab Diamond Bergo Lova Instant Khimar Veil no ped\r\n\r\nMaterial = Diamond\r\n\r\n- super neat stitching >> other colors are still in the production process\r\n\r\nWeight = 135 grams",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/06/e5fa1cb23e7ca49052c5a8a81a534b85.jpeg"
}
]
]
},
{
"support": 1,
"items": [
[
{
"title": "Instan Hijab Triangle",
"price": 25000,
"description": "Bahan Lembut, Cocok untuk berpergian dan bersantai. Instant Hijab Triangle Veil Instant Triangle Lace Veil Amelia Lace Triangle\r\n\r\nColor: Amelia Softpink, Amelia Softpeach, Amelia Navy, Amelia Black\r\nType: instant triangle hijab\r\nMaterial: pollycatton\r\nWeight: 120 grams",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/05/025c74dc748fb1ebc76e95d7be7f85b2.jpeg"
},
{
"title": "Satin Square",
"price": 25000,
"description": "Bahan hijab satin sangat baik dan berkualitas. Terlihat mengilap dan lembut, serta ringan saat disentuh. Ketika dikenakan hijab ini nyaman dan tak membuat rasa panas. Untuk kamu yang suka dengan tampilan berbeda, andalkan saja hijab satin ini yang cocok untuk gaya kasual hingga kondangan.",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/05/b9ec3e70e56c34c97cc578bc2f027fe2.jpeg"
},
{
"title": "Pashmina Ceruti Starp",
"price": 50000,
"description": "Pashmina Ceruty strap Pasmina Babydoll Ceruty hijab pasmina strap\r\nkarakteristik bahan :\r\n- Lentur/jatuh kebawah sehingga mudah dibentuk.\r\n- Tekstur ringan, halus dan lembut. nyaman untuk dipakai sehari hari.\r\n- Tidak mudah kusut.\r\n\r\nMaterial = Babydoll ceruty\r\nSize = 175 x 75 cm\r\nEdge = neat sewing\r\n\r\nWeight = 120 grams\r\n",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/06/9b7d781d5c2c1bbb73ba7d5615b7677f.jpeg"
},
{
"title": "Hijab Simple Fat Serration",
"price": 35000,
"description": "Khimar simple pet serration / instant veil pet simple serration\r\n\r\nMaterial = Wolvis grade A\r\n\r\nsuper neat stitching >> other colors are still in production process\r\n\r\nWeight = 155 grams",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/06/00277781e24c7552d21411b3deef11d8.jpeg"
},
{
"title": "Pahsmina Baby Doll",
"price": 35000,
"description": "Pashmina baby doll ruffle Pashmina ceruty rempel pasmina sabyan kriwil\r\n\r\nMaterial = Ceruty\r\nSize = 75 x 175 cm\r\nEdge = neat sewing\r\n\r\nWeight = 130 grams",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/06/dd1a41504bf4279a80a1c83922329401-600x600.jpeg"
},
{
"title": "Hijab Quadril Syar'i",
"price": 44000,
"description": "Hijab Quadril Syar'i Diamond Hijab Quadrilateral\r\n\r\nIngredients = Italiano Diamond\r\n\r\nSize = 145 x 145 cm\r\n\r\nEdges = boutique-style sewing edges\r\n\r\nWeight = 210 grams",
"image": "https://www.irvanmart.com/wp-content/uploads/2020/06/87fcc99a88694bbdcf36841e7671a5cd.jpeg"
}
]
]
}
]
<div *ngFor="let i of myjson">
<h2>support: {{i.support}}</h2>
<div *ngFor="let item of support?.items[0]">
<p>title: {{ item.title }}</p>
<p>price: {{ item.price }}</p>
<p>description: {{ item.description }}</p>
<img [src]="item.image" />
</div>
</div>

Getting separate street number and street name from Foursquare search api?

I'm using the Foursquare's venue search API and everything is working as expected. But the response does not contain separate fields for street number and street address. It contains one field named "address" that contains both, like the example below
"location": {
"address": "180 Orchard St",
"crossStreet": "btwn Houston & Stanton St",
"lat": 40.72173744277209,
"lng": -73.98800687282996,
"labeledLatLngs": [
{
"label": "display",
"lat": 40.72173744277209,
"lng": -73.98800687282996
}
],
"distance": 8,
"postalCode": "10002",
"cc": "US",
"city": "New York",
"state": "NY",
"country": "United States",
"formattedAddress": [
"180 Orchard St (btwn Houston & Stanton St)",
"New York, NY 10002",
"United States"
]
I need to have the street number and street name separately. Is there anyway to get a response that has them separated? or the only way is for me to parse it?

Update inner object in arangodb

I have an object stored in arangodb which has additional inner objects, my current use case requires that I update just one of the elements.
Store Object
{
"status": "Active",
"physicalCode": "99999",
"postalCode": "999999",
"tradingCurrency": "USD",
"taxRate": "14",
"priceVatInclusive": "No",
"type": "eCommerce",
"name": "John and Sons inc",
"description": "John and Sons inc",
"createdDate": "2015-05-25T11:04:14+0200",
"modifiedDate": "2015-05-25T11:04:14+0200",
"physicalAddress": "Corner moon and space 9 station",
"postalAddress": "PO Box 44757553",
"physicalCountry": "Mars Sector 9",
"postalCountry": "Mars Sector 9",
"createdBy": "john.doe",
"modifiedBy": "john.doe",
"users": [
{
"id": "577458630580",
"username": "john.doe"
}
],
"products": [
{
"sellingPrice": "95.00",
"inStock": "10",
"name": "School Shirt Green",
"code": "SKITO2939999995",
"warehouseId": "723468998682"
},
{
"sellingPrice": "95.00",
"inStock": "5",
"name": "School Shirt Red",
"code": "SKITO245454949495",
"warehouseId": "723468998682"
},
{
"sellingPrice": "95.00",
"inStock": "10",
"discount": "5%",
"name": "School Shirt Blue",
"code": "SKITO293949495",
"warehouseId": "723468998682"
}
]
}
I want to change just one of the products stock value
{
"sellingPrice": "95.00",
"inStock": "10",
"discount": "5%",
"name": "School Shirt Blue",
"code": "SKITO293949495",
"warehouseId": "723468998682"
}
Like update store product stock less 1 where store id = x, something to this effect
FOR store IN stores
FILTER store._key == "837108415472"
FOR product IN store.products
FILTER product.code == "SKITO293949495"
UPDATE product WITH { inStock: (product.inStock - 1) } IN store.products
Apart from the above possibly it makes sense to store product as a separate document in collection store_products. I believe in NOSQL that is the best approach to reduce document size.
Found answer
here arangodb-aql-update-single-object-in-embedded-array and there
arangodb-aql-update-for-internal-field-of-object
I however believe it is best to maintain separate documents and rather use joins when retrieving. Updates easily

Fancy name generator in node.js

Is there a fancy name generator in nodejs to create names like heroku does for creating applications ?
I'm thinking of names like "yellow_birds", "beautifull_summer" and stuff like that.
Otherwise, are there any dictionnary to pickup cool words ?
Not specific to node, but I've found the following haiku generator here. You could adapt it the following way:
function haiku(){
var adjs = ["autumn", "hidden", "bitter", "misty", "silent", "empty", "dry",
"dark", "summer", "icy", "delicate", "quiet", "white", "cool", "spring",
"winter", "patient", "twilight", "dawn", "crimson", "wispy", "weathered",
"blue", "billowing", "broken", "cold", "damp", "falling", "frosty", "green",
"long", "late", "lingering", "bold", "little", "morning", "muddy", "old",
"red", "rough", "still", "small", "sparkling", "throbbing", "shy",
"wandering", "withered", "wild", "black", "young", "holy", "solitary",
"fragrant", "aged", "snowy", "proud", "floral", "restless", "divine",
"polished", "ancient", "purple", "lively", "nameless"]
, nouns = ["waterfall", "river", "breeze", "moon", "rain", "wind", "sea",
"morning", "snow", "lake", "sunset", "pine", "shadow", "leaf", "dawn",
"glitter", "forest", "hill", "cloud", "meadow", "sun", "glade", "bird",
"brook", "butterfly", "bush", "dew", "dust", "field", "fire", "flower",
"firefly", "feather", "grass", "haze", "mountain", "night", "pond",
"darkness", "snowflake", "silence", "sound", "sky", "shape", "surf",
"thunder", "violet", "water", "wildflower", "wave", "water", "resonance",
"sun", "wood", "dream", "cherry", "tree", "fog", "frost", "voice", "paper",
"frog", "smoke", "star"];
return adjs[Math.floor(Math.random()*(adjs.length-1))]+"_"+nouns[Math.floor(Math.random()*(nouns.length-1))];
}
Take a look to these modules:
https://github.com/faker-js/faker, can generate all kinds of fake data, also localised.
https://github.com/weaver/moniker, this one seems to do just what you need.
https://github.com/nodeca/charlatan
https://github.com/boo1ean/casual
https://github.com/seancannon/goby

Resources