(Full description and list of commands at - https://npmjs.org/doc/index.html)
##List of less common (however useful) NPM commands
######Install a package and also update package.json with the installed version and package name.
var mongoose = require('mongoose'); | |
mongoose.connect('localhost', 'testing_multiTenant'); | |
/** | |
* User schema. | |
*/ | |
var UserSchema = new mongoose.Schema({ | |
name: String | |
, prefix: { type: String, required: true } |
using Telerik.Windows.Controls; | |
namespace System.Windows.Interactivity | |
{ | |
public class PullToRefreshBehavior : Behavior<RadDataBoundListBox> | |
{ | |
/// <summary> | |
/// Gets or sets a value indicating whether the RefreshLabel in the PullToRefreshLoading indicator should be updated. | |
/// </summary> | |
public bool UpdateRefreshLabel { get; set; } |
public static class IEnumerableExtensions | |
{ | |
/// <summary> | |
/// Batches up an enumerable and yields you a sequence of arrays. | |
/// </summary> | |
public static IEnumerable<T[]> Batch<T>(this IEnumerable<T> sequence, int batchSize) | |
{ | |
var batch = new List<T>(batchSize); | |
foreach (var item in sequence) |
(Full description and list of commands at - https://npmjs.org/doc/index.html)
##List of less common (however useful) NPM commands
######Install a package and also update package.json with the installed version and package name.
namespace System.Collections.Specialized | |
{ | |
using System.Collections.Generic; | |
using System.Linq; | |
/// <summary> | |
/// Represents a collection of associated String keys and String values that can be accessed either with the key | |
/// or with the index. | |
/// </summary> | |
public class NameValueCollection : IEnumerable<KeyValuePair<string, string>> |
namespace System.Collections.Specialized | |
{ | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
public static class NameValueCollectionExtensions | |
{ | |
public static IDictionary<string, string> ToDictionary(this NameValueCollection source) | |
{ |
using System; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Converters; | |
public class UnixDateTimeConverter : DateTimeConverterBase | |
{ | |
/// <summary> | |
/// Reads the JSON representation of the object. | |
/// </summary> | |
/// <param name="reader">The <see cref="JsonReader"/> to read from.</param> |
using System.Threading.Tasks; | |
using Telerik.Everlive.Sdk.Core.Result; | |
namespace Telerik.Everlive.Sdk.Core.Facades | |
{ | |
public static class FacadesExtensions | |
{ | |
public static Task<T> ExecuteAsync<T>(this AsyncFacade<T> facade) | |
{ | |
var tcs = new TaskCompletionSource<T>(); |
using System; | |
using System.Collections.Generic; | |
#if WINDOWS_PHONE_8 | |
namespace Windows.Security.Credentials | |
#else | |
namespace System.Security.Credentials | |
#endif | |
{ | |
/// <summary> |
using System.Web.Helpers; | |
namespace System.Web.Mvc | |
{ | |
public static class HtmlExtensions | |
{ | |
const string AntiForgeryCookieName = "XSRF-TOKEN"; | |
public static IHtmlString AngularJSAntiForgeryToken(this HtmlHelper html) | |
{ |